ℹ️ From a discord discussion https://discord.com/channels/953974421008293909/1480597126932201542
Lexical version: 0.41.0
Steps To Reproduce
- Create custom node that
canBeEmpty and isInline methods returns true
- Move emptyable custom node inside ListItemNode
- Delete the text from the сustom node by pressing Backspace
- Delete ListItemNode by pressing Backspace
Link to code example: https://codesandbox.io/p/sandbox/lexical-link-inside-listitem-flp5vk
The current behavior
ListItemNode is removed, but custom InlineElement remains in state
The expected behavior
An empty inline element is also removed if its parent element is removed
Impact of fix
lexical-playground doesn't have an example of a node that can be both empty and inline, so it's unclear how common it is among Lexical users. A fix for the case without affecting the core logic would be nice anyway.
ℹ️ From a discord discussion https://discord.com/channels/953974421008293909/1480597126932201542
Lexical version: 0.41.0
Steps To Reproduce
canBeEmptyandisInlinemethods returnstrueLink to code example: https://codesandbox.io/p/sandbox/lexical-link-inside-listitem-flp5vk
The current behavior
ListItemNode is removed, but custom InlineElement remains in state
The expected behavior
An empty inline element is also removed if its parent element is removed
Impact of fix
lexical-playground doesn't have an example of a node that can be both empty and inline, so it's unclear how common it is among Lexical users. A fix for the case without affecting the core logic would be nice anyway.