lexical icon indicating copy to clipboard operation
lexical copied to clipboard

Bug: block cursor shown instead of normal one

Open thorn0 opened this issue 1 year ago • 2 comments

Lexical version: 0.14.2

Steps To Reproduce

  1. 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.
  2. 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.

thorn0 avatar Mar 30 '24 12:03 thorn0

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.

ivailop7 avatar Mar 30 '24 18:03 ivailop7

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.

etrepum avatar Feb 10 '25 02:02 etrepum