lexical
lexical copied to clipboard
Bug: block cursor shown instead of normal one
Lexical version: 0.14.2
Steps To Reproduce
- Open https://stackblitz.com/edit/facebook-lexical-4cu2rd?file=src%2FApp.tsx and notice that the cursor is correctly shown as a block cursor at the end of the collapsible container, after the horizontal rule.
- Using the right arrow key, start moving the cursor forward.
The current behavior
The cursor keeps being shown as a block cursor inside the container even though the selection moves to the next paragraph as expected (can be seen in the debug tree view). The real cursor is invisible. It gets visible when the user starts typing.
The expected behavior
When the selection moves to the next paragraph, the real cursor should become visible and be shown there, the block cursor should hide.
Yeah, I think this was related to any element node being the last node. In this case since collapsible container is a shadowRoot, it's essentially the last node inside.
This is still reproducible, whatever heuristic is being used to remove the block cursor just isn't getting triggered when it gets stuck in this state. I think it has something to do with updates that don't go through a full reconciliation.