facebook / facebook/lexical

Bug: Editor steals focus to other components when AutoLinkPlugin is present

Open
#5,016 2 comments 2 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
23.9k
Forks
2.2k
Avg merge
1d 14h
Merged PRs (30d)
55

Description

## Lexical version:
@lexical/react 0.10.0
lexical 0.10.0

as well with
@lexical/react 0.12.2
lexical 0.12.2

## Link to code example:
https://codesandbox.io/s/lexical-editor-focus-problem-with-autolinknode-88md65

## Steps To Reproduce

1. start the sandbox
2. type something in the first input (should work)
3. type something in the second one, the lexical editor (should work as well)
4. type something in the first input (focus should return to the editor)
5. remove the `AutoLinkPlugin` on line 42 of `Editor.tsx`
2. type something in the first input (should work)
3. type something in the second one, the lexical editor (should work as well)
4. 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.