From 1c9f1ba82c0a66f9cf5cfbce1b26d94f77dc4343 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 22 Sep 2025 20:06:01 +0300 Subject: [PATCH] chore(global_menu): dismiss menu when entering fullscreen --- apps/client/src/widgets/buttons/global_menu.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/client/src/widgets/buttons/global_menu.tsx b/apps/client/src/widgets/buttons/global_menu.tsx index 39fcb88e8..73f126913 100644 --- a/apps/client/src/widgets/buttons/global_menu.tsx +++ b/apps/client/src/widgets/buttons/global_menu.tsx @@ -155,7 +155,7 @@ function ZoomControls({ parentComponent }: { parentComponent?: Component | null useEffect(updateZoomState, []); - function ZoomControlButton({ command, title, icon, children }: { command: KeyboardActionNames, title: string, icon?: string, children?: ComponentChildren }) { + function ZoomControlButton({ command, title, icon, children, dismiss }: { command: KeyboardActionNames, title: string, icon?: string, children?: ComponentChildren, dismiss?: boolean }) { const linkRef = useRef(null); useStaticTooltipWithKeyboardShortcut(linkRef, title, command, { placement: "bottom", @@ -167,8 +167,10 @@ function ZoomControls({ parentComponent }: { parentComponent?: Component | null tabIndex={0} onClick={(e) => { parentComponent?.triggerCommand(command); - setTimeout(() => updateZoomState(), 300) - e.stopPropagation(); + setTimeout(() => updateZoomState(), 300); + if (!dismiss) { + e.stopPropagation(); + } }} className={`dropdown-item-button ${icon}`} >{children} @@ -184,7 +186,7 @@ function ZoomControls({ parentComponent }: { parentComponent?: Component | null {t("global_menu.zoom")} <>
- +   {zoomLevel}{t("units.percentage")}