From aa37ffe3d57162b3d7beb6f53ef51a7c5fb33746 Mon Sep 17 00:00:00 2001 From: Rodrigo Lino da Costa <5201282+rlinoz@users.noreply.github.com> Date: Mon, 22 Jul 2024 17:34:58 -0300 Subject: [PATCH] Revert "fix: Web - Split - Enter and CMD+Enter open user profile instead of splitting expense." --- .../ButtonWithDropdownMenu/index.tsx | 26 +++---------------- .../ButtonWithDropdownMenu/types.ts | 3 --- .../MoneyRequestConfirmationList.tsx | 3 --- src/components/SettlementButton.tsx | 9 +------ 4 files changed, 4 insertions(+), 37 deletions(-) diff --git a/src/components/ButtonWithDropdownMenu/index.tsx b/src/components/ButtonWithDropdownMenu/index.tsx index d1e36327a1a3..094c26a2b387 100644 --- a/src/components/ButtonWithDropdownMenu/index.tsx +++ b/src/components/ButtonWithDropdownMenu/index.tsx @@ -4,7 +4,6 @@ import Button from '@components/Button'; import Icon from '@components/Icon'; import * as Expensicons from '@components/Icon/Expensicons'; import PopoverMenu from '@components/PopoverMenu'; -import useKeyboardShortcut from '@hooks/useKeyboardShortcut'; import useStyleUtils from '@hooks/useStyleUtils'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; @@ -34,7 +33,6 @@ function ButtonWithDropdownMenu({ onOptionSelected, enterKeyEventListenerPriority = 0, wrapperStyle, - useKeyboardShortcuts = false, }: ButtonWithDropdownMenuProps) { const theme = useTheme(); const styles = useThemeStyles(); @@ -67,26 +65,6 @@ function ButtonWithDropdownMenu({ }); } }, [windowWidth, windowHeight, isMenuVisible, anchorAlignment.vertical]); - - useKeyboardShortcut( - CONST.KEYBOARD_SHORTCUTS.CTRL_ENTER, - (e) => { - onPress(e, selectedItem.value); - }, - { - captureOnInputs: true, - shouldBubble: false, - isActive: useKeyboardShortcuts, - }, - ); - - useEffect(() => { - if (!!caretButton.current || !buttonRef?.current || !(shouldAlwaysShowDropdownMenu || options.length > 1)) { - return; - } - caretButton.current = buttonRef.current; - }, [buttonRef, options.length, shouldAlwaysShowDropdownMenu]); - return ( {shouldAlwaysShowDropdownMenu || options.length > 1 ? ( @@ -94,7 +72,9 @@ function ButtonWithDropdownMenu({