You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After deleting the text between the links, the links are merged into one node, but the cursor moves to the end of the node
merging.links.cursor.mov
The expected behavior
The link nodes are merged into one, but the cursor remains
Impact of fix
Link merging is a useful feature that prevents the creation of unnecessary nodes #8236, but it is important to leave the cursor in the same position after deleting the last character of a TextNode to avoid spoiling the UX.
Lexical version: 0.42.0
Steps To Reproduce
Link to code example: https://playground.lexical.dev/#doc=H4sIAAAAAAAAE9VSy04DMQz8FTTnqNuWPiAfwIkDUo-IQ9iYNqqbrLze0qraf0fZpZRyqETFhVM8Y9kzHuUA8kGTLNQpwR4gKWl-y1VgLxRhny8BT-oCww4N3pJsnHblJnmCRcwMw6DWPWcCBko7hcUj7ULp-CYz-yr3uobBlqQOKcKO2hcDH4RK7XBsmE8ieVWInmIv-LmDQ1yf7TAQ4uOsOlmSfqGg2VMPGmFYrFSr2hYF9-YGnrYFWnP9le_0eulA80dh1kHpHwT5exuVE7cUV61-eMknPpwSynBxTOUKme7PnyXWGrCrdeG25GFH8_l0Orud3U3Gk3uDOjVS5rkndvulpCb679MYDibjwRDtB6Oc0AtcAwAA
The current behavior
After deleting the text between the links, the links are merged into one node, but the cursor moves to the end of the node
merging.links.cursor.mov
The expected behavior
The link nodes are merged into one, but the cursor remains
Impact of fix
Link merging is a useful feature that prevents the creation of unnecessary nodes #8236, but it is important to leave the cursor in the same position after deleting the last character of a TextNode to avoid spoiling the UX.