Skip to content

Commit

Permalink
Revert "Select end if root has no children (#3254)"
Browse files Browse the repository at this point in the history
This reverts commit 64cc4d3.
  • Loading branch information
acywatson authored Oct 27, 2022
1 parent f1af8fc commit b3b6ef5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/lexical/src/LexicalEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -816,10 +816,12 @@ export class LexicalEditor {
if (selection !== null) {
// Marking the selection dirty will force the selection back to it
selection.dirty = true;
} else if (options.defaultSelection === 'rootStart') {
root.selectStart();
} else {
root.selectEnd();
} else if (root.getChildrenSize() !== 0) {
if (options.defaultSelection === 'rootStart') {
root.selectStart();
} else {
root.selectEnd();
}
}
},
{
Expand Down

0 comments on commit b3b6ef5

Please sign in to comment.