JSFiddle - React, Tailwind, and code Playground

HTML

<div id="test1" contenteditable="true">The first line
  <div>XX put cursor here and press the BACKSPACE key to join the two lines. see everything to the right of this disappear XX<span id="span1" contenteditable="false">A NOT EDITABLE SPAN</span> SOME MORE TEXT</div></div>