So, for the Delete/Backspace events, you can try to add the following to
form.js — let me know if it worked:
— Above
document.addEventListener('mouseup', function(){ add the following function:
function handleKeyDown(event) {
if (event.key === "Delete" || event.key === "Backspace") {
selektionEvent='';
myField.focus();
}
}
— Above
function insertAtCursor... add the following:
document.addEventListener("keydown", handleKeyDown);
That probably should fix 90% of cases when the selection is not reset — but now it will be after Delete or Backspace keyboard's button pressed.