<!-- Please provide a clear and concise description of what the bug is. Include screenshots if needed. Please test using the latest version of the relevant Lexical packages to make sure your issue has not already been fixed. --> Lexical version: 0.49 latest ## Steps To Reproduce 1. Define an ElementNode with the `getDOMSlot` method 2. Insert a node with text content into the editor 3. Delete the text content <!-- Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than Lexical. Issues without reproduction steps or code examples may be closed as not actionable. --> Link to code example: https://codesandbox.io/p/sandbox/3xpqzc <!-- Please provide a CodeSandbox (https://codesandbox.io/s/new) or (https://stackblitz.com/github/facebook/lexical/tree/main/examples/react-plain-text?file=src%2FApp.tsx&terminalHeight=0&ctl=1&showSidebar=0&devtoolsheight=0&view=preview), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve. --> ## The current behavior When a node with a DOM slot is empty, it lacks a managed line break, so node visually collapses as if it had been completely removed https://github.com/user-attachments/assets/c6ff08fe-f1c3-4dca-86c1-c4fd0acfce1e ## The expected behavior A managed line break is set if the DOMSlot is empty, similar to the standard DOM structure for an ElementNode ## Impact of fix It would be better if the managed line break were handled entirely by lexical
Lexical version: 0.49 latest
Steps To Reproduce
getDOMSlotmethodLink to code example: https://codesandbox.io/p/sandbox/3xpqzc
The current behavior
When a node with a DOM slot is empty, it lacks a managed line break, so node visually collapses as if it had been completely removed
Screen.Recording.2026-08-12.at.02.04.51.mov
The expected behavior
A managed line break is set if the DOMSlot is empty, similar to the standard DOM structure for an ElementNode
Impact of fix
It would be better if the managed line break were handled entirely by lexical