Skip to content

Commit

Permalink
Revert "Select end if root has no children (#3254)" (#3276)
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 1a0228e
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

2 comments on commit 1a0228e

@vercel
Copy link

@vercel vercel bot commented on 1a0228e Oct 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

lexical – ./packages/lexical-website

lexical-fbopensource.vercel.app
lexical-git-main-fbopensource.vercel.app
www.lexical.dev
lexicaljs.com
lexicaljs.org
lexical.dev

@vercel
Copy link

@vercel vercel bot commented on 1a0228e Oct 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

lexical-playground – ./packages/lexical-playground

lexical-playground-fbopensource.vercel.app
playground.lexical.dev
lexical-playground-git-main-fbopensource.vercel.app
lexical-playground.vercel.app

Please sign in to comment.