When focused, the div has spell checking enabled which is fine. However, when the div is no longer in focus and there are spelling errors, the spell checking red squiggle lines remain.
Following the accepted answer suggested in this question:
spellcheck=false on contentEditable elements
I added event listeners on the blur and focus events that toggle between edit.spellcheck = false;
and edit.spellcheck = true;
to prevent the red squiggle lines from appearing when the div is no longer in focus but the problem still persist.
.edit {
border: 1px solid gray;
}
<div class="edit" contenteditable="true"></div>