Commit e83871d4 authored by Camil Staps's avatar Camil Staps 🍃

Potential fix for #211: pressing delete when whole query is selected deletes the input field

parent 289a31af
......@@ -1009,9 +1009,15 @@ if (make_content_editable) {
this.setCaretPosition(caret);
};
form_str.onkeydown = function(e) {
if (e.keyCode == 13) {
if (e.keyCode == 13) { /* enter */
formsubmit();
return false;
} else if (e.keyCode == 46 || e.keyCode == 8) { /* delete / backspace */
if (window.getSelection().toString() == this.innerText) {
this.innerText = '';
this.oninput();
return false;
}
}
};
form_str.oninput();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment