Skip to content

Commit

Permalink
Merge pull request #9682 from Expensify/Rory-FixArrowNavigatorWithTwo…
Browse files Browse the repository at this point in the history
…Options

Fix ArrowKeyFocusManager for lists with only two options
  • Loading branch information
amyevans authored Jul 5, 2022
2 parents 941ea9a + efb3fbf commit 5ad8542
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/ArrowKeyFocusManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ArrowKeyFocusManager extends Component {
const arrowDownConfig = CONST.KEYBOARD_SHORTCUTS.ARROW_DOWN;

this.unsubscribeArrowUpKey = KeyboardShortcut.subscribe(arrowUpConfig.shortcutKey, () => {
if (this.props.maxIndex <= 1) {
if (this.props.maxIndex < 1) {
return;
}

Expand All @@ -41,7 +41,7 @@ class ArrowKeyFocusManager extends Component {
}, arrowUpConfig.descriptionKey, arrowUpConfig.modifiers, true);

this.unsubscribeArrowDownKey = KeyboardShortcut.subscribe(arrowDownConfig.shortcutKey, () => {
if (this.props.maxIndex <= 1) {
if (this.props.maxIndex < 1) {
return;
}

Expand Down

0 comments on commit 5ad8542

Please sign in to comment.