Void nodes not being deleted using removeNodeByKey
See original GitHub issueHey again! I ran into this issue where I am unable to delete a void block using removeNodeByKey
- the same method works for inline nodes. For void block nodes, it doesn’t seem to remove it from the DOM even though it is removed from Slate state.
I am able to remove it by the default backspace behavior though.
Here is a fiddle illustrating that - https://jsfiddle.net/rzwn92np/2/
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Why my node isn't getting deleted on using free() or delete
Your code is too complicated. There are multiple problems: addNode() allocates a new node but does not use it when recursing.
Read more >Commands - Slate
Insert a new inline at a range , splitting the text to make room if it is non-empty. If the selection is expanded,...
Read more >Deleting a Node from the List
In this case, the first Node of the linked list is deleted. The first Node is called head. To delete a Node at...
Read more >Delete Node in a BST - LeetCode
So we find the node with value 3 and delete it. One valid answer is [5,4,6,2,null,null,7], shown in the above BST. Please notice...
Read more >Given a binary tree, how do you remove all the half nodes?
if current nodes is a half node with left. child NULL left, then it's right child is. returned and replaces it in the...
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 Free
Top 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
removeNodeByKey works well 😉 The problem is that the click on the button leads to onChange by the editor it self. Wich comes after your clickFunction. It gets overwritte. I stopped the click event and everything works well:
https://jsfiddle.net/bunterWolf/pqb5cehn/
Hey folks! I just ran into this as well trying to create my first removable void node —I wonder if the docs should mention calling preventDefault from your custom
onClick
handler? I ran into the problem following this example, which makes a removableimg
: https://docs.slatejs.org/guides/changes#2.-from-custom-node-components