Skip to content
This repository was archived by the owner on Feb 6, 2023. It is now read-only.
This repository was archived by the owner on Feb 6, 2023. It is now read-only.

Unlucky keypresses get ignored due to buggy bailout logic #1830

@sophiebits

Description

@sophiebits

If you have an editor containing

ABC
defghi

and replace "d" with "A", or "e" with "B", or "f" with "C" by selecting the character and typing the new one, nothing happens.

That's because this check mistakenly slices relative to the entire editor content but the indices it's using are relative to a particular block:

https://github.com/facebook/draft-js/blob/2d7ad181d60b97a87e2f6fff6557ae31c02a8749/src/component/handlers/edit/editOnBeforeInput.js#L120-L127

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions