diff --git a/apps/client/src/features/editor/components/table/handle/cell-chevron.tsx b/apps/client/src/features/editor/components/table/handle/cell-chevron.tsx index db79844e..ebac82dd 100644 --- a/apps/client/src/features/editor/components/table/handle/cell-chevron.tsx +++ b/apps/client/src/features/editor/components/table/handle/cell-chevron.tsx @@ -11,6 +11,7 @@ import clsx from "clsx"; import { useTranslation } from "react-i18next"; import { isCellSelection } from "@docmost/editor-ext"; import { CellChevronMenu } from "./menus/cell-chevron-menu"; +import { refocusEditorAfterMenuClose } from "./hooks/use-column-row-menu-lifecycle"; import classes from "./handle.module.css"; interface CellChevronProps { @@ -87,6 +88,7 @@ export const CellChevron = React.memo(function CellChevron({ const onClose = useCallback(() => { editor.commands.unfreezeHandles(); + refocusEditorAfterMenuClose(editor); }, [editor]); if (!cellDom) return null; diff --git a/apps/client/src/features/editor/components/table/handle/hooks/use-column-row-menu-lifecycle.ts b/apps/client/src/features/editor/components/table/handle/hooks/use-column-row-menu-lifecycle.ts index a3059559..100750bf 100644 --- a/apps/client/src/features/editor/components/table/handle/hooks/use-column-row-menu-lifecycle.ts +++ b/apps/client/src/features/editor/components/table/handle/hooks/use-column-row-menu-lifecycle.ts @@ -11,6 +11,39 @@ interface Args { tablePos: number; } +/** + * Restore focus to the editor after a table handle/cell menu closes. + * + * The grip/chevron menus are Mantine `