FormidableLabs / FormidableLabs/use-editable

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

Open
#20 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
619
Forks
16
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.