I'm handling text using contentEditable
and onInput
on <div>
<>
<div
contentEditable
data-which="title"
onClick={e => {
e.stopPropagation();
e.preventDefault();
}}
onInput={(e) => alter(e)}
className={styles.widgetSignalTitleText}
>
{widget.alterations.title}
</div>
</>
After I insert a text at the end of existing text, the blinking cursor is shifting to the start of the whole text. How can this be prevented?