Skip to content

Does CLEAR_EDITOR_COMMAND shift focus? #2085

Answered by trueadm
tpatalas asked this question in Q&A
Discussion options

You must be logged in to vote

Yes. This is intended here, as when you clear the editor, it moves selection to the start of the empty editor – so in a way, it's triggering an auto selection by doing this. As you're doing clearing both editors, the 2nd will also get the last selection trigger. What would your desired effect here be?

I'd recommend maybe creating your own onClear function and passing it to <LexicalClearEditorPlugin>. That way you can opt to clear the editor, but not move focus to the end.

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@tpatalas
Comment options

Answer selected by thegreatercurve
Comment options

You must be logged in to vote
3 replies
@trueadm
Comment options

trueadm Dec 15, 2022
Collaborator

@chalecki
Comment options

@trueadm
Comment options

trueadm Dec 16, 2022
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants