Skip to content

Commit

Permalink
Revert "remove timeout on search focus"
Browse files Browse the repository at this point in the history
This reverts commit 0e4411c.
  • Loading branch information
TMisiukiewicz committed Oct 25, 2023
1 parent 0e4411c commit aeba274
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/OptionsSelector/BaseOptionsSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ class BaseOptionsSelector extends Component {
this.subscribeToKeyboardShortcut();

if (this.props.isFocused && this.props.autoFocus && this.textInput) {
this.textInput.focus();
this.focusTimeout = setTimeout(() => {
this.textInput.focus();
}, CONST.ANIMATED_TRANSITION);
}

this.scrollToIndex(this.props.selectedOptions.length ? 0 : this.state.focusedIndex, false);
Expand Down Expand Up @@ -137,6 +139,10 @@ class BaseOptionsSelector extends Component {
}

componentWillUnmount() {
if (this.focusTimeout) {
clearTimeout(this.focusTimeout);
}

this.unSubscribeFromKeyboardShortcut();
}

Expand Down

0 comments on commit aeba274

Please sign in to comment.