Reputation: 445
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.
Upvotes: 1
Views: 339
Reputation: 384
you CHANGE the state for each click and you display it. Cursor is reset when state is updated
replace onInput
with onBlur
Upvotes: 1