Skip to content

Bug: Ctrl+A doesn't work well in PlainTextPlugin on Firefox #7578

Closed
@wataru-chocola

Description

@wataru-chocola

Lexical version: 0.31.2

Steps To Reproduce

  1. Clone lexical repository.
  2. Move examples/react-plain-text.
  3. Run npm install & npm run dev.
  4. Visit dev site using Firefox.
  5. Enter any text which ends with LineBreak (e.g. aaa\naaa\n)
  6. 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions