diff --git a/src/hooks/useArrowKeyFocusManager.ts b/src/hooks/useArrowKeyFocusManager.ts index 934f65800939..507adcb0df19 100644 --- a/src/hooks/useArrowKeyFocusManager.ts +++ b/src/hooks/useArrowKeyFocusManager.ts @@ -129,7 +129,7 @@ export default function useArrowKeyFocusManager({ useKeyboardShortcut(CONST.KEYBOARD_SHORTCUTS.ARROW_DOWN, arrowDownCallback, arrowConfig); const arrowLeftCallback = useCallback(() => { - if (maxIndex < 0) { + if (maxIndex < 0 || !allowHorizontalArrowKeys) { return; } @@ -151,11 +151,11 @@ export default function useArrowKeyFocusManager({ } return newFocusedIndex; }); - }, [disableCyclicTraversal, disabledIndexes, maxIndex]); - useKeyboardShortcut(CONST.KEYBOARD_SHORTCUTS.ARROW_LEFT, allowHorizontalArrowKeys ? arrowLeftCallback : () => {}, arrowConfig); + }, [allowHorizontalArrowKeys, disableCyclicTraversal, disabledIndexes, maxIndex]); + useKeyboardShortcut(CONST.KEYBOARD_SHORTCUTS.ARROW_LEFT, arrowLeftCallback, arrowConfig); const arrowRightCallback = useCallback(() => { - if (maxIndex < 0) { + if (maxIndex < 0 || !allowHorizontalArrowKeys) { return; } @@ -177,8 +177,8 @@ export default function useArrowKeyFocusManager({ } return newFocusedIndex; }); - }, [disableCyclicTraversal, disabledIndexes, maxIndex]); - useKeyboardShortcut(CONST.KEYBOARD_SHORTCUTS.ARROW_RIGHT, allowHorizontalArrowKeys ? arrowRightCallback : () => {}, arrowConfig); + }, [allowHorizontalArrowKeys, disableCyclicTraversal, disabledIndexes, maxIndex]); + useKeyboardShortcut(CONST.KEYBOARD_SHORTCUTS.ARROW_RIGHT, arrowRightCallback, arrowConfig); // Note: you don't need to manually manage focusedIndex in the parent. setFocusedIndex is only exposed in case you want to reset focusedIndex or focus a specific item return [focusedIndex, setFocusedIndex]; diff --git a/src/libs/EmojiUtils.ts b/src/libs/EmojiUtils.ts index 3629f5a31f12..fe79ea68a0b3 100644 --- a/src/libs/EmojiUtils.ts +++ b/src/libs/EmojiUtils.ts @@ -551,7 +551,7 @@ const getEmojiReactionDetails = (emojiName: string, reaction: ReportActionReacti function getSpacersIndexes(allEmojis: EmojiPickerList): number[] { const spacersIndexes: number[] = []; allEmojis.forEach((emoji, index) => { - if (!('spacer' in emoji)) { + if (!(CONST.EMOJI_PICKER_ITEM_TYPES.SPACER in emoji)) { return; }