From b0d81a4699c69de1657d46d49ab16020d77b08ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hanno=20J=2E=20G=C3=B6decke?= Date: Tue, 15 Aug 2023 15:42:50 +0200 Subject: [PATCH] fix: leave auto focus logic to input component --- .../OptionsSelector/BaseOptionsSelector.js | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/components/OptionsSelector/BaseOptionsSelector.js b/src/components/OptionsSelector/BaseOptionsSelector.js index b894e8c3bfc1..7273616ea57e 100755 --- a/src/components/OptionsSelector/BaseOptionsSelector.js +++ b/src/components/OptionsSelector/BaseOptionsSelector.js @@ -96,18 +96,6 @@ class BaseOptionsSelector extends Component { ); this.scrollToIndex(this.props.selectedOptions.length ? 0 : this.state.focusedIndex, false); - - if (!this.props.autoFocus) { - return; - } - - if (this.props.shouldShowTextInput) { - if (this.props.shouldDelayFocus) { - this.focusTimeout = setTimeout(() => this.textInput.focus(), CONST.ANIMATED_TRANSITION); - } else { - this.textInput.focus(); - } - } } componentDidUpdate(prevProps) { @@ -339,6 +327,8 @@ class BaseOptionsSelector extends Component { selectTextOnFocus blurOnSubmit={Boolean(this.state.allOptions.length)} spellCheck={false} + autoFocus={this.props.autoFocus} + shouldDelayFocus={this.props.shouldDelayFocus} /> ); const optionsList = (