react-sane-contenteditable icon indicating copy to clipboard operation
react-sane-contenteditable copied to clipboard

fix occasional range error

Open emilia-friedberg opened this issue 5 years ago • 2 comments

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.

emilia-friedberg avatar Nov 08 '19 17:11 emilia-friedberg

Hi Emilia,

Would it be possible to add a test case demonstrating the error?

Thanks! — Ash

ashleyw avatar Nov 08 '19 20:11 ashleyw

@ashleyw I added a test that I hope clarifies the error I was experiencing! Let me know if you have questions.

emilia-friedberg avatar Nov 09 '19 01:11 emilia-friedberg