dillon1000/react

Commit

Ensure selection range exists

The selection object doesn't always have ranges. In Chrome the
selection is not updated before 'focus' event handlers are fired. See
http://jsfiddle.net/t4DYA/ for example.

The selection will have rangeCount of 0 and calling getRangeAt(0) will
throw error "Uncaught IndexSizeError: Index or size was negative, or greater
than the allowed value."
Browse files
Changed paths1 file
First-parent comparison
M src/core/ReactInputSelection.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…