I am creating a website builder. For Text edit, I m using contentEditable and to capture its state I m using the onInput event. but I don't know why every time I type something cursor goes to start.
CodePudding user response:
you CHANGE the state for each click and you display it. Cursor is reset when state is updated
replace onInput
with onBlur