Skip to content

Error when adding a selection outside the editor while not editing #395

Closed
@YoranBrondsema

Description

When the editing mode is disabled, adding a selection outside of the editor (for example by triple clicking) throws an error.

Error: Could not find parent section for un-mapped text node "outside section"

I started a PR with a failing test: #394.

However, before I continue, @bantic maybe you can tell me what the best way to proceed would be. My thinking would be to exclude any selection outside of the editor. So when a selection includes a node after the editor, limit the selection to the last node in the editor. And if a selection includes a node from before the editor, limit the selection to the first node in the editor.

This will however, prevent from selecting anything outside of the editor. Alternatively, one could "split" the selection in two. Have the editor part handled by mobiledoc-kit and leave the other part as it is. I'm not sure how feasible that is so I'd like to have your input.

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