Closed
Description
Lexical version: 0.31.2
Steps To Reproduce
- Clone lexical repository.
- Move
examples/react-plain-text
. - Run npm install & npm run dev.
- Visit dev site using Firefox.
- Enter any text which ends with LineBreak (e.g.
aaa\naaa\n
) - Enter
Ctrl+A
.
The current behavior
Selection contains only first line text.
root
└ (2) paragraph
> ├ (3) text "aaa"
├ (4) linebreak
├ (5) text "aaa"
└ (6) linebreak
selection: range
├ anchor { key: 3, offset: 0, type: text }
└ focus { key: 2, offset: 1, type: element }
The expected behavior
Selection contains all elements.
root
└ (2) paragraph
> ├ (3) text "aaa"
> ├ (4) linebreak
> ├ (5) text "aaa"
> └ (6) linebreak
selection: range
├ anchor { key: 3, offset: 0, type: text }
└ focus { key: 2, offset: 4, type: element }
Additions
It works well on Chrome.