weechatRN

Weechat relay client for iOS using websockets https://github.com/mhoran/weechatRN
git clone http://git.hanabi.in/repos/weechatRN.git
Log | Files | Refs | README | LICENSE

commit 42695243f6aed653a672ffa26816e3dcaa07fd7d
parent 3e30e62a07f99cc71a6fb2f12caf32ed0e6d8d7e
Author: Matthew Horan <matt@matthoran.com>
Date:   Sun, 27 Oct 2019 17:55:13 -0400

Disable multiline input

There's a bug on iOS with TextInput when multiline=true and the value of
the TextInput is programmatically changed.

See https://github.com/facebook/react-native/issues/27019.

Diffstat:
Msrc/usecase/buffers/ui/BufferContainer.tsx | 11+++--------
1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/src/usecase/buffers/ui/BufferContainer.tsx b/src/usecase/buffers/ui/BufferContainer.tsx @@ -71,6 +71,7 @@ class BufferContainer extends React.Component<Props, State> { }); LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut); } + handleOnBlur() { LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut); this.setState({ @@ -96,14 +97,9 @@ class BufferContainer extends React.Component<Props, State> { } } - clearTextInput = false; - handleChangeText = (textValue: string) => { this.tabCompleteInProgress = false; - this.setState({ - textValue: this.clearTextInput ? "" : textValue - }); - this.clearTextInput = false + this.setState({textValue}); }; handleSubmit = () => { @@ -111,7 +107,7 @@ class BufferContainer extends React.Component<Props, State> { textValue.split("\n").forEach((line) => { this.props.sendMessage(line); }); - this.clearTextInput = true; + this.handleChangeText(""); }; tabCompleteNick = () => { @@ -199,7 +195,6 @@ class BufferContainer extends React.Component<Props, State> { returnKeyType="send" blurOnSubmit={false} onSubmitEditing={this.handleSubmit} - multiline={true} enablesReturnKeyAutomatically={true} /> {showTabButton && (