1

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?

codingrohtak
  • 160
  • 8
  • https://stackoverflow.com/questions/1181700/set-cursor-position-on-contenteditable-div/75514935#75514935 I have answered here. Hope that helps – devin Feb 20 '23 at 22:59

0 Answers0