react-sane-contenteditable
react-sane-contenteditable copied to clipboard
fix occasional range error
Include the node.length
in the getSafeCaretPosition
function in order to solve IndexError
that was arising out of an invalid range length in the instance where the state's value is longer than the length of the node in the ref.
Hi Emilia,
Would it be possible to add a test case demonstrating the error?
Thanks! — Ash
@ashleyw I added a test that I hope clarifies the error I was experiencing! Let me know if you have questions.