You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: Editor steals focus to other components when AutoLinkPlugin is present #5016
type something in the second one, the lexical editor (should work as well)
type something in the first input (focus should return to the editor)
remove the AutoLinkPlugin on line 42 of Editor.tsx
type something in the first input (should work)
type something in the second one, the lexical editor (should work as well)
type something in the first input (should work as well)
The current behavior
One input is a simple text field and the other one is the lexical editor. When typing into the first one, the focus returns to the lexical editor. This happens only if AutoLinkPlugin is present.
The expected behavior
If typing something in the first input field the focus should stay there.
Reacted by Moises Marquez and Henning Thomas Flath
I also encountered this issue - in my case it was causing cryptic scroll jumps. I have multiple editors in one page (they are a part of an infinite scroller), and the scroll was pinned to the bottom whenever new editors loaded in. The problem was caused by the last editor taking focus.
I implemented a workaround until this gets fixed - I attached focus listeners to the _rootElement, and only enable the AutoLinkPlugin when a particular editor gets focused.
I opened #9425 to fix this: registering a transform no longer moves focus or the DOM selection into an editor that doesn't have focus, so AutoLinkPlugin re-rendering no longer steals focus from other inputs.
Activity
ipeterov commentedon Apr 1, 2024
I also encountered this issue - in my case it was causing cryptic scroll jumps. I have multiple editors in one page (they are a part of an infinite scroller), and the scroll was pinned to the bottom whenever new editors loaded in. The problem was caused by the last editor taking focus.
I implemented a workaround until this gets fixed - I attached focus listeners to the
_rootElement, and only enable theAutoLinkPluginwhen a particular editor gets focused.ruxandra-anghel commentedon Nov 7, 2024
Plus 1, also discovered this issue
[lexical] Bug Fix: Registering a transform no longer moves focus into…
Vedthakar commentedon Oct 21, 2026
I opened #9425 to fix this: registering a transform no longer moves focus or the DOM selection into an editor that doesn't have focus, so
AutoLinkPluginre-rendering no longer steals focus from other inputs.— Ved Thakar
[lexical] Bug Fix: Registering a transform no longer moves focus into…