mdx-editor / mdx-editor/editor
Error when deleting a thematic break
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3.7k
- Forks
- 307
- Avg merge
- 14h 22m
- Merged PRs (30d)
- 5
Description
Hi,
I'm having an issue with deleting thematic breaks. Once inserted, it can only be deleted by pressing backspace twice. However, doing the following throws an error:
- Insert a thematic break
- Press on backspace once (this causes the caret to disappear)
- Now press on the thematic break line or slightly above or below it to place the caret under the line
- Press on backspace again
This the error I'm seeing:
Uncaught Error: updateEditor: selection has been lost because the previously selected nodes have been removed and selection wasn't moved to another node. Ensure selection changes after removing/replacing a selected node.
at beginUpdate (Lexical.dev.js:8229:1)
at updateEditor (Lexical.dev.js:8282:1)
at LexicalEditor.update (Lexical.dev.js:9798:1)
at triggerCommandListeners (Lexical.dev.js:8079:1)
at dispatchCommand (Lexical.dev.js:1237:1)
at HTMLDivElement.eventHandler (Lexical.dev.js:3064:1)
The issue can be re-produced on the live demo as well, it shows the following error on the console logs:
Uncaught Error: Minified Lexical error #19; visit https://lexical.dev/docs/error?code=19 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at Z (593-b5b58497930ed062.js:5:31202)
at n7 (593-b5b58497930ed062.js:5:103168)
at n8 (593-b5b58497930ed062.js:5:103784)
at rh.update (593-b5b58497930ed062.js:5:117199)
at n6 (593-b5b58497930ed062.js:5:100395)
at tA (593-b5b58497930ed062.js:5:45526)
at e._lexicalHandled.e._lexicalHandled (593-b5b58497930ed062.js:5:115732)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the sequence in the live demo and use the reported Lexical.dev.js stack trace to investigate the lost selection after deleting the thematic break. Done means pressing backspace in this state no longer throws an error and the caret remains usable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100