diff --git a/libs/components/editor-plugins/src/menu/group-menu/GropuMenu.tsx b/libs/components/editor-plugins/src/menu/group-menu/GropuMenu.tsx index 790ee98636..781c2c3a25 100644 --- a/libs/components/editor-plugins/src/menu/group-menu/GropuMenu.tsx +++ b/libs/components/editor-plugins/src/menu/group-menu/GropuMenu.tsx @@ -168,6 +168,12 @@ export const GroupMenu = function ({ editor, hooks }: GroupMenuProps) { useEffect(() => { setShowMenu(false); + + if (groupBlock) { + const unobserve = groupBlock.onUpdate(() => setGroupBlock(null)); + return unobserve; + } + return undefined; }, [groupBlock]); return ( diff --git a/libs/components/editor-plugins/src/menu/left-menu/LeftMenuDraggable.tsx b/libs/components/editor-plugins/src/menu/left-menu/LeftMenuDraggable.tsx index 996857c2ad..4f10f16fbe 100644 --- a/libs/components/editor-plugins/src/menu/left-menu/LeftMenuDraggable.tsx +++ b/libs/components/editor-plugins/src/menu/left-menu/LeftMenuDraggable.tsx @@ -184,6 +184,14 @@ export const LeftMenuDraggable: FC = props => { return () => sub.unsubscribe(); }, [blockInfo, editor]); + useEffect(() => { + if (block?.block != null) { + const unobserve = block.block.onUpdate(() => setBlock(undefined)); + return unobserve; + } + return undefined; + }, [block?.block]); + useEffect(() => { const sub = lineInfo.subscribe(data => { if (data == null) {