mirror of https://github.com/fantasticit/think.git
fix: fix enter in title
This commit is contained in:
parent
2a2644ef66
commit
080bb1eb55
|
@ -61,6 +61,8 @@ export const Title = Node.create<TitleOptions>({
|
||||||
const titleNode = $head.node($head.depth);
|
const titleNode = $head.node($head.depth);
|
||||||
const endPos = titleNode.firstChild.nodeSize + 1;
|
const endPos = titleNode.firstChild.nodeSize + 1;
|
||||||
|
|
||||||
|
dispatch(state.tr.insert(endPos, paragraph.create()));
|
||||||
|
|
||||||
const newState = view.state;
|
const newState = view.state;
|
||||||
const next = new TextSelection(newState.doc.resolve(endPos + 2));
|
const next = new TextSelection(newState.doc.resolve(endPos + 2));
|
||||||
dispatch(newState.tr.setSelection(next));
|
dispatch(newState.tr.setSelection(next));
|
||||||
|
|
Loading…
Reference in New Issue