From a43e886e489d3877ad01bff58ad119d702d68054 Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Mon, 12 Aug 2024 21:22:22 +0530 Subject: [PATCH] fix: Report fields - App crashes when disabling/enabling list values via checkbox & dropdown button. Signed-off-by: krishna2323 --- src/components/ButtonWithDropdownMenu/index.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/ButtonWithDropdownMenu/index.tsx b/src/components/ButtonWithDropdownMenu/index.tsx index 1eeadde84c47..943d6dbb5c16 100644 --- a/src/components/ButtonWithDropdownMenu/index.tsx +++ b/src/components/ButtonWithDropdownMenu/index.tsx @@ -78,7 +78,15 @@ function ButtonWithDropdownMenu({ 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,