From 3532a0518c397d53782d7c9ae36b30ddfb61e3ef Mon Sep 17 00:00:00 2001 From: Abdelhafidh Belalia <16493223+s77rt@users.noreply.github.com> Date: Mon, 28 Nov 2022 21:17:26 +0100 Subject: [PATCH] Fixed: If you close the keyboard using native back button then it will keep reopening while selecting the contacts --- src/components/OptionsSelector/BaseOptionsSelector.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/OptionsSelector/BaseOptionsSelector.js b/src/components/OptionsSelector/BaseOptionsSelector.js index 7fce40647c3f..3210e860798d 100755 --- a/src/components/OptionsSelector/BaseOptionsSelector.js +++ b/src/components/OptionsSelector/BaseOptionsSelector.js @@ -206,12 +206,13 @@ class BaseOptionsSelector extends Component { */ selectRow(option, ref) { if (this.props.shouldFocusOnSelectRow) { - // Input is permanently focused on native platforms, so we always highlight the text inside of it - setSelection(this.textInput, 0, this.props.value.length); if (this.relatedTarget && ref === this.relatedTarget) { this.textInput.focus(); + this.relatedTarget = null; + } + if (this.textInput.isFocused()) { + setSelection(this.textInput, 0, this.props.value.length); } - this.relatedTarget = null; } this.props.onSelectRow(option);