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.

Myriad of bugs when decorators do not wrap the decorated text #1327

Open
@lukebarnard1

Description

@lukebarnard1

Do you want to request a feature or report a bug?
bug

What is the current behavior?
Doing character insertion or deletion at the edge of an entity causes the immutable entity to become text.

https://jsfiddle.net/hpeobuvz/2/

This feels highly related to #627 and #1200. I've observed that we only experience issues when the sum length of the text nodes contained in the decorator does not equal the length of the decorated range. Otherwise, the decorated Entity behaves exactly as expected, even when the decoration contains images.

What is the expected behavior?

Inserting a character after an immutable entity does not destroy the entity.

Which versions of Draft.js, and which browser / OS are affected by this issue? Did this work in previous versions of Draft.js?

Seemingly all setups. This has always affected draft.js but in this instance we're using 0.11.0-alpha.

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