mirror of
https://github.com/docmost/docmost.git
synced 2026-06-10 18:16:57 +08:00
feat: editor inline status node (#1973)
* inline status node * fix alignment * fix * typed storage * fix math block popup on select all
This commit is contained in:
@@ -46,8 +46,11 @@ export default function MathInlineView(props: NodeViewProps) {
|
||||
}, [preview, isEditing]);
|
||||
|
||||
useEffect(() => {
|
||||
setIsEditing(!!props.selected);
|
||||
if (props.selected) setPreview(node.attrs.text);
|
||||
const pos = getPos();
|
||||
const { from, to } = editor.state.selection;
|
||||
const nodeSelected = props.selected && from === pos && to === pos + node.nodeSize;
|
||||
setIsEditing(nodeSelected);
|
||||
if (nodeSelected) setPreview(node.attrs.text);
|
||||
}, [props.selected]);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user