mirror of
https://github.com/docmost/docmost.git
synced 2026-05-23 02:32:42 +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:
@@ -56,8 +56,11 @@ export default function MathBlockView(props: NodeViewProps) {
|
||||
}, [debouncedPreview]);
|
||||
|
||||
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