Skip to content

Bug: composition breaks when replacing selection starting with formatted text #8119

@kimseongyu

Description

@kimseongyu

Lexical version: 0.40.0
Environment:

  • macOS(Chrome) works incorrectly
  • window(Chrome) works correctly
  • macOS(Safari) works correctly
  • macOS(firefox) works correctly

Steps To Reproduce

  1. Type "hello world" in the editor
  2. Apply a format only to the first word
  3. Select the entire string
  4. Start typing a composition character(e.g. Korean '가' by typing 'ㄱ' then 'ㅏ')

Link to code example: https://playground.lexical.dev/#doc=H4sIAAAAAAAAE52QQUvEQAyF_4q-87BMpd3F-QGehR7Fw9CJ24HsTEnT1bL0v8t0lXVFRDyF90K-l-QEClGztOqV4E6QnLXUro8chBLc0zcRSH1kOGvwkuXgFa4yOORAcEjFYRiMOnMxYKD0pnDoiTkXOQ-lsboGR5Ix5gRXLeZHtv0L--Y1C4fb3-jPBiEKdbrqNDFfMgoppkDpnPfBGLz4vfihvwKdMx8ulxfZfm70j5j141erLgbsR239kQJctdvZuqmbZnu_vTMY8yRdmXtkP-8lTyl8nYbd1HZjsbwDTqVV89oBAAA

The current behavior

issue.mov

The first composition input disappears, characters don't combine correctly.

The expected behavior

The entire selection should be replaced by the first stroke of the composition, and the state should remain active to complete the character

Impact of fix

Metadata

Metadata

Assignees

No one assigned

    Labels

    compositionRelating to IME inputs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions