From 1308a1d0d0e638df509130c95f71ecfdd3a53b65 Mon Sep 17 00:00:00 2001 From: Charis <26616127+charislam@users.noreply.github.com> Date: Fri, 4 Sep 2026 09:39:42 -0400 Subject: [PATCH] fix(studio): close popover menu when dragging block (FE-4301) (#49912) ## Summary * Closes the block options popover (grip dropdown menu) when a drag operation starts on that block * Fixes the issue where the menu would remain visible during the drag if it was already open ## Summary by CodeRabbit * **Bug Fixes** * Section action menus now remain closed when dragging begins, preventing delayed reopening and keeping the editing interface clear and focused. --- apps/studio/components/ui/SortableSection.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/studio/components/ui/SortableSection.tsx b/apps/studio/components/ui/SortableSection.tsx index fa66764ab6d..1c31fcaa49f 100644 --- a/apps/studio/components/ui/SortableSection.tsx +++ b/apps/studio/components/ui/SortableSection.tsx @@ -27,7 +27,11 @@ export const SortableSection = ({ useDndMonitor({ onDragStart: (event) => { - if (event.active.id === id) isDraggingRef.current = true + if (event.active.id === id) { + isDraggingRef.current = true + clearTimeout(openTimeoutRef.current) + setMenuOpen(false) + } }, onDragEnd: (event) => { if (event.active.id === id) isDraggingRef.current = false