From 0349003775a7b0906449cfdda8608598adea77eb Mon Sep 17 00:00:00 2001 From: Guillim Date: Mon, 16 Jun 2025 16:07:13 +0200 Subject: [PATCH] Force close dropdown when using cmdK (#12506) ### Issue: overflow of input fields when opening the side panel. Could be imporved with a better command menu state handling ### Solution: In command menu hooks, we now close all dropdowns when opening the side panel. This ensures all UI elements are close properly before the sidepanel shows up Fixes : https://github.com/twentyhq/twenty/issues/12485 Co-authored-by: Charles Bochet --- .../src/modules/command-menu/hooks/useCommandMenu.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenu.ts b/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenu.ts index 1ca2ef269..288bc6b6b 100644 --- a/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenu.ts +++ b/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenu.ts @@ -37,13 +37,14 @@ export const useCommandMenu = () => { ); const openCommandMenu = useCallback(() => { + closeAnyOpenDropdown(); navigateCommandMenu({ page: CommandMenuPages.Root, pageTitle: 'Command Menu', pageIcon: IconDotsVertical, resetNavigationStack: true, }); - }, [navigateCommandMenu]); + }, [closeAnyOpenDropdown, navigateCommandMenu]); const toggleCommandMenu = useRecoilCallback( ({ snapshot, set }) =>