Bug: Editor lost its own selection when focus set inside external dialogs
- Dominant language
- TypeScript
- Stars
- 23.9k
- Forks
- 2.2k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 61
Description
Lexical version: 0.13.1
## Steps To Reproduce
1. Type any text.
2. Click on 'Insert link' button.
3. Wait until the dialog opens and sets focus.
4. Click on 'Insert link' button a few times.
https://github.com/facebook/lexical/assets/3251933/4648471a-b677-4689-8db4-e359c82c361c
## The current behavior
`$getSelection()` returns null.
Contributor guide
Research direction
Start by reproducing the Insert link dialog sequence described in the issue, focusing on what happens when the dialog sets focus and the button is clicked repeatedly. Trace the editor selection handling across those focus changes and add a regression test; done means $getSelection() still returns the editor's selection after the dialog interaction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100