From ee3f0500f233de6876e8b3be83dbc27693862baf Mon Sep 17 00:00:00 2001 From: enahum Date: Tue, 21 Nov 2017 13:40:02 -0300 Subject: [PATCH] Fix search auto focus on iOS (#1176) --- app/components/search_bar/search_box.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/components/search_bar/search_box.js b/app/components/search_bar/search_box.js index 8365a89f6..803337e5e 100644 --- a/app/components/search_bar/search_box.js +++ b/app/components/search_bar/search_box.js @@ -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();