Improve insertBefore, insertAfter, replace selection restoration logic (#3516)

This commit is contained in:
Dominic Gannaway
2022-12-08 10:13:21 +00:00
committed by GitHub
parent d30c88202e
commit ae6b4c3bcf
15 changed files with 91 additions and 54 deletions

View File

@ -69,9 +69,12 @@ export class OverflowNode extends ElementNode {
return false;
}
insertNewAfter(selection: RangeSelection): null | LexicalNode {
insertNewAfter(
selection: RangeSelection,
restoreSelection = true,
): null | LexicalNode {
const parent = this.getParentOrThrow();
return parent.insertNewAfter(selection);
return parent.insertNewAfter(selection, restoreSelection);
}
excludeFromCopy(): boolean {