Skip to content

moving cards in disabled editor can cause editor.range to go out of sync #475

@bantic

Description

@bantic

In a disabled editor, the _readRangeFromDOM method no-ops. This can cause editor.range to stay cached on an old state. If that range references sections that have since been programmatically deleted from the post, unexpected errors can happen, for example when snapshotting the range (to add to the undo stack), the range.head.section is expected to have a post property, but if that section has been removed it no longer will. This causes an error in the position#leafSectionIndex code.

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