Fix search auto focus on iOS (#1176)

This commit is contained in:
enahum 2017-11-21 13:40:02 -03:00 committed by Harrison Healey
parent 8b08a44820
commit ee3f0500f2

View file

@ -137,7 +137,12 @@ export default class Search extends Component {
};
focus = () => {
this.refs.input_keyword.getNode().focus();
InteractionManager.runAfterInteractions(() => {
const input = this.refs.input_keyword.getNode();
if (!input.isFocused()) {
input.focus();
}
});
};
onBlur = () => {
@ -198,6 +203,7 @@ export default class Search extends Component {
duration: 200
}
).start();
this.focus();
if (this.props.onDelete) {
this.props.onDelete();