dillon1000/react
Commit
Browse files 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."
Changed paths1 file
First-parent comparisonsrc/core/ReactInputSelection.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…