Automated cherry pick of #4132 (#4181)

* MM-22041 Fix Keyboard flashing when entering keyboards screen

* Update snapshots

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
This commit is contained in:
Mattermost Build 2020-04-18 07:52:06 +02:00 committed by GitHub
parent c48a5e3b61
commit f407bd0568
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 6 deletions

View file

@ -193,7 +193,6 @@ NotificationSettingsMentionsKeywords {
<TextInputWithLocalizedPlaceholder
autoCapitalize="none"
autoCorrect={false}
autoFocus={true}
blurOnSubmit={true}
keyboardAppearance="light"
multiline={true}

View file

@ -36,6 +36,16 @@ export default class NotificationSettingsMentionsKeywords extends PureComponent
this.navigationEventListener = Navigation.events().bindComponent(this);
}
componentDidAppear() {
if (this.keywordsInput) {
this.keywordsInput.focus();
}
}
componentDidDisappear() {
this.props.onBack(this.state.keywords);
}
handleSubmit = () => {
popTopScreen();
};
@ -48,10 +58,6 @@ export default class NotificationSettingsMentionsKeywords extends PureComponent
return this.setState({keywords});
};
componentDidDisappear() {
this.props.onBack(this.state.keywords);
}
render() {
const {theme, isLandscape} = this.props;
const {keywords} = this.state;
@ -66,7 +72,6 @@ export default class NotificationSettingsMentionsKeywords extends PureComponent
>
<View style={style.inputContainer}>
<TextInputWithLocalizedPlaceholder
autoFocus={true}
ref={this.keywordsRef}
value={keywords}
blurOnSubmit={true}