- escape from edit message now focuses on send_textarea

- allow swipes to happen when send_textarea is focused but empty
This commit is contained in:
RossAscends
2023-04-20 23:58:12 +09:00
parent 7fb3d1f578
commit d452467818
2 changed files with 18 additions and 5 deletions

View File

@ -5073,6 +5073,7 @@ $(document).ready(function () {
$(document).keyup(function (e) { $(document).keyup(function (e) {
if (e.key === "Escape") { if (e.key === "Escape") {
closeMessageEditor(); closeMessageEditor();
$("#send_textarea").focus();
} }
}); });

View File

@ -655,9 +655,21 @@ $("document").ready(function () {
} }
}); });
function isInputElementInFocus() { function isInputElementInFocus() {
return $(document.activeElement).is(":input"); //return $(document.activeElement).is(":input");
var focused = $(':focus');
if (focused.is('input') || focused.is('textarea')) {
if (focused.attr('id') === 'send_textarea') {
return false;
} }
return true;
}
return false;
}
//Additional hotkeys CTRL+ENTER and CTRL+UPARROW //Additional hotkeys CTRL+ENTER and CTRL+UPARROW