After typing the selection retains the style and format from the deleted paragraph
The expected behavior
The inserted text should match the style and format of the selection
Impact of fix
Bug is 100% reliably reproducible and does not align with existing text editor behaviours.
The root cause might be in Selection.removeText. Specifically, when removing text in this scenario, TextNode.selectEnd is called, but it merely updates the anchor/offset. However, the style and format are not applied from the node.
Lexical version: 0.19.0
Steps To Reproduce
https://github.com/user-attachments/assets/d2c732d8-4172-4521-934f-043088ed4915
The current behavior
The expected behavior
Impact of fix
Bug is 100% reliably reproducible and does not align with existing text editor behaviours.
The root cause might be in
Selection.removeText
. Specifically, when removing text in this scenario,TextNode.selectEnd
is called, but it merely updates the anchor/offset. However, the style and format are not applied from the node.