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.
  • Loading branch information
Beamanator authored Aug 13, 2024
2 parents 4483c6f + a43e886 commit 8cf898d
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 8cf898d

Please sign in to comment.