Skip to content

Commit

Permalink
Merge pull request #47244 from Krishna2323/krishna2323/issue/47230
Browse files Browse the repository at this point in the history
[CP Staging] fix: Report fields - App crashes when disabling/enabling list values via checkbox & dropdown button.

(cherry picked from commit 8cf898d)

(CP triggered by Beamanator)
  • Loading branch information
Beamanator authored and OSBotify committed Aug 13, 2024
1 parent fcf193c commit 047fcba
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/components/ButtonWithDropdownMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,15 @@ function ButtonWithDropdownMenu<IValueType>({
useKeyboardShortcut(
CONST.KEYBOARD_SHORTCUTS.CTRL_ENTER,
(e) => {
onPress(e, selectedItem.value);
if (shouldAlwaysShowDropdownMenu || options.length) {
if (!isSplitButton) {
setIsMenuVisible(!isMenuVisible);
return;
}
onPress(e, selectedItem?.value);
} else {
onPress(e, options[0]?.value);
}
},
{
captureOnInputs: true,
Expand Down

0 comments on commit 047fcba

Please sign in to comment.