Bug: In an editable EditorState after Parsed, typing will create a new TextNode instead of continuing with the last TextNode
See original GitHub issueLexical version: 0.3.6
Steps To Reproduce
With TextNode
- Refresh browser in code sandbox link
- Editor should AutoFocus
- type anything, see in TreeView that a new
TextNode
was created
With AutoLinkNode
- Uncomment
SerializedAutoLinkNode
json instate
- Refresh browser in code sandbox link
- Editor should AutoFocus
- type
m
to complete the link, see in TreeView that a new TextNode withm
was created, andAutoLinkNode
was destructed
Link to code example:
https://codesandbox.io/s/lexical-plain-text-example-forked-t3cgjf?file=/src/Editor.js
The current behavior
- On fresh parsing, editor won’t consider the last
TextNode
, will blindly create a newTextNode
and won’t merge it with its predecessor
The expected behavior
- The last
TextNode
should be open for edit, new input should be considered part of that TextNode AutoLinkNode
shouldn’t collapse, it should take new input as part of its childTextNode
Issue Analytics
- State:
- Created a year ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Doc's TextNode goes as a content to the wrong node - Discuss
Now this is how i parse the initial content and i create the doc that will be passed to the editor's view state...
Read more >handler function never given text node · Issue #525 - GitHub
I have installed a handleClickOn prop. Here is the problem: whenever I click any of the words, the node argument given to the...
Read more >ProseMirror Changelog
Work around a Safari bug where it draws the cursor at the start of the line when it is after an uneditable node...
Read more >JavaScript TextNode update - dom - Stack Overflow
I would like to change the text inside the parent without using removeChild , createTextNode and appendChild . Why would I need this...
Read more >Reference Manual - CodeMirror
To update a state, you create a transaction, which produces a new state ... character offset when it is a text node) at...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah, I guess once state is serialized you can recursively run through the tree to cleanup unused fields, and once it loaded for to be passed into editor do same, but to populate default values. I want to hear more from other folks whether they can think of any downsides of supporting missed fields and using default values before doing this change
That’s exactly what I’ve been doing. Look forward to the resolution 😃