facebook / facebook/lexical

Bug: When editable config changed the onBlur not firing.

Open
#4,856 2 comments 0 reactions 0 assignees View on GitHub
core
Dominant language
TypeScript
Stars
23.9k
Forks
2.2k
Avg merge
1d 16h
Merged PRs (30d)
61

Description

Lexical version:

## Steps To Reproduce

I created a codesandbox, but couldn't replicate the issue I'm facing, because when I tried to toggle `editable` it didn't work.
Just register an onBlur plugin, and toggle the editable with a button.
On my site when I turned editalbe: false to true the onBlur event wasn't fired.

Link to code example:
https://codesandbox.io/s/onblur-not-working-6v7g37?file=/src/Editor.js:1048-1060

## The current behavior
BLUR_COMMAND not triggered when toggled editable from false to true.
## The expected behavior
It should trigger the onblur event listener.

Contributor guide

Open the contributing guide

Research direction

Start with the linked CodeSandbox at src/Editor.js:1048-1060 and reproduce toggling editable with an onBlur plugin. Trace the BLUR_COMMAND path when editable changes from false to true. Done means the onBlur event listener is triggered reliably after the toggle, with the behavior covered by an appropriate regression test.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.