lexical icon indicating copy to clipboard operation
lexical copied to clipboard

Bug: Editor lost its own selection when focus set inside external dialogs

Open placeba opened this issue 11 months ago • 2 comments

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.

placeba avatar Mar 07 '24 08:03 placeba

Facing same problem, +1

WoodenPC avatar Apr 16 '24 07:04 WoodenPC

I've seen users add onMouseDown={(e) => e.preventDefault()} to menu items to prevent losing editor focus/selection.

Obviously it would be nice if this wasn't an issue.

acmoles avatar Jul 31 '24 15:07 acmoles