react-simplemde-editor icon indicating copy to clipboard operation
react-simplemde-editor copied to clipboard

The cursor changes position by itself

Open vikshv opened this issue 3 years ago • 4 comments

versions. 5.00 and 5.0.2 react/react-dom: 16.8.6 "Controlled usage" example

hold down the key -> the cursor goes to the beginning

on version 4.1.5 is not reproduced

vikshv avatar Oct 07 '21 09:10 vikshv

I suspect that it's because I forgot to wrap onChange in useCallback so "new" onChange handler causes this behavior. Please try that and let me know if it will fix your issue.

Changed README respectively

RIP21 avatar Oct 08 '21 13:10 RIP21

I use useCallback

image image

vikshv avatar Oct 11 '21 07:10 vikshv

I suspect that it's because I forgot to wrap onChange in useCallback so "new" onChange handler causes this behavior. Please try that and let me know if it will fix your issue.

Changed README respectively

Confirmed the same issue on react-simplemde-editor version 5.0.1 with the onChange function wrapped in useCallback. Reverting to 4.1.5 until this is fixed.

nscarlson avatar Oct 20 '21 18:10 nscarlson

Weird. Will look into it once I have some free time.

RIP21 avatar Oct 20 '21 19:10 RIP21

Cannot reproduce. You can check yourself how demo is working.

RIP21 avatar Oct 01 '22 22:10 RIP21