Skip to content

Commit

Permalink
Fix funciton order
Browse files Browse the repository at this point in the history
  • Loading branch information
puneetlath committed Feb 28, 2024
1 parent f0e99ce commit c318f69
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/components/OptionsSelector/BaseOptionsSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,19 @@ class BaseOptionsSelector extends Component {
this.unSubscribeFromKeyboardShortcut();
}

handleFocusIn() {
const activeElement = document.activeElement;
this.setState({
disableEnterShortCut: activeElement && this.accessibilityRoles.includes(activeElement.role) && activeElement.role !== CONST.ROLE.PRESENTATION,
});
}

handleFocusOut() {
this.setState({
disableEnterShortCut: false,
});
}

/**
* @param {Array<Object>} allOptions
* @returns {Number}
Expand Down Expand Up @@ -266,19 +279,6 @@ class BaseOptionsSelector extends Component {
this.props.onChangeText(value);
}

handleFocusIn() {
const activeElement = document.activeElement;
this.setState({
disableEnterShortCut: activeElement && this.accessibilityRoles.includes(activeElement.role) && activeElement.role !== CONST.ROLE.PRESENTATION,
});
}

handleFocusOut() {
this.setState({
disableEnterShortCut: false,
});
}

subscribeActiveElement() {
if (!this.isWebOrDesktop) {
return;
Expand Down

0 comments on commit c318f69

Please sign in to comment.