From c318f699e52569b3ac20e78c4febf5bf8fdde2d4 Mon Sep 17 00:00:00 2001 From: Puneet Lath Date: Wed, 28 Feb 2024 17:50:12 -0500 Subject: [PATCH] Fix funciton order --- .../OptionsSelector/BaseOptionsSelector.js | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/components/OptionsSelector/BaseOptionsSelector.js b/src/components/OptionsSelector/BaseOptionsSelector.js index 690897d548ce..8a9b80ac36e9 100755 --- a/src/components/OptionsSelector/BaseOptionsSelector.js +++ b/src/components/OptionsSelector/BaseOptionsSelector.js @@ -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} allOptions * @returns {Number} @@ -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;