Skip to content

Uncaught DOMException: Failed to execute 'getRangeAt' on 'Selection': 0 is not a valid index. #20

Open
@kof

Description

@kof

Hi, just bumped into this, the solution is to check selection.rangeCount !== 0 before calling selectino.getRangeAt(0)

https://stackoverflow.com/questions/22935320/uncaught-indexsizeerror-failed-to-execute-getrangeat-on-selection-0-is-not

I got into this because I called getState() while disabled option is true

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