Inline NodeView with text content doesn't handle deletion correctly when last character is deleted #1365
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hey guys. I'm currently looking into an issue with our NodeViews not handling the deletion of text content correctly when an inline node view has
content: 'text*'in it's schema.See this issue:
https://github.com/ueberdosis/tiptap/issues/3451
You can see inside the codesandbox provided (https://codesandbox.io/s/dazzling-james-xn3fnn?file=/src/App.js) that the node length will stay 1 when each character is deleted one by one or 0 if it's deleted by SelectAll => Backspace.
After that, the state for the node doesn't seem to update anymore (the nodes length stays 1/0 and the changes done inside are not written into the state).
This doesn't happen, if the content is set to
paragraph*for example since then it seems the schema is working correctly.Now the question would be - is it actually correct to use text directly in a Node? From what I've seen it feels like the state drops the node internally whenever the content is empty - but our node view renderer is not reflecting that change?
Would love to hear some insight - don't need a direct solution but maybe a heads up on what could happen here and if this is even correct Prosemirror behavior / usage.
Thanks! 😀
Can this issue be reproduced without the React/Tiptap stuff?
I'll give it a shot, I'll come back to this issue tomorrow
@bdbch could you update on this issue?