Skip to content

Commit

Permalink
Merge pull request #35241 from software-mansion-labs/fix-cmd-enter-se…
Browse files Browse the repository at this point in the history
…lectionList

Fix CMD+Enter in SelectionList

(cherry picked from commit 9dc595a)
  • Loading branch information
cristipaval authored and OSBotify committed Jan 29, 2024
1 parent 671461a commit a360c2a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/SelectionList/BaseSelectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function BaseSelectionList<TItem extends User | RadioItem>(
onScrollBeginDrag,
headerMessage = '',
confirmButtonText = '',
onConfirm = () => {},
onConfirm,
headerContent,
footerContent,
showScrollIndicator = false,
Expand Down Expand Up @@ -379,10 +379,10 @@ function BaseSelectionList<TItem extends User | RadioItem>(
});

/** Calls confirm action when pressing CTRL (CMD) + Enter */
useKeyboardShortcut(CONST.KEYBOARD_SHORTCUTS.CTRL_ENTER, onConfirm, {
useKeyboardShortcut(CONST.KEYBOARD_SHORTCUTS.CTRL_ENTER, onConfirm ?? selectFocusedOption, {
captureOnInputs: true,
shouldBubble: !flattenedSections.allOptions[focusedIndex],
isActive: !disableKeyboardShortcuts && !!onConfirm && isFocused,
isActive: !disableKeyboardShortcuts && isFocused,
});

return (
Expand Down

0 comments on commit a360c2a

Please sign in to comment.