diff --git a/packages/client/src/tiptap/core/menus/mind/bubble.tsx b/packages/client/src/tiptap/core/menus/mind/bubble.tsx index 264d92b0..d8afd259 100644 --- a/packages/client/src/tiptap/core/menus/mind/bubble.tsx +++ b/packages/client/src/tiptap/core/menus/mind/bubble.tsx @@ -13,16 +13,16 @@ import { copyNode, deleteNode, getEditorContainerDOMSize } from 'tiptap/prose-ut import { triggerOpenMindSettingModal } from '../_event'; export const MindBubbleMenu = ({ editor }) => { + const { width: maxWidth } = getEditorContainerDOMSize(editor); const attrs = useAttributes(editor, Mind.name, { defaultShowPicker: false, createUser: '', + width: 0, + height: 0, }); - const { defaultShowPicker, createUser } = attrs; + const { defaultShowPicker, createUser, width, height } = attrs; const { user } = useUser(); - const { width: maxWidth } = getEditorContainerDOMSize(editor); - const { width, height } = useAttributes(editor, Mind.name, { width: 0, height: 0 }); - const setSize = useCallback( (size) => { editor.chain().updateAttributes(Mind.name, size).setNodeSelection(editor.state.selection.from).focus().run();