Merge #16026 - Fixes #15224 - Don't fire keyboard shortcuts while SQL query area is focused

Pull-request: #16026
Fixes #15224

Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
William Desportes 2020-03-20 00:02:22 +01:00
commit 646f83cbfd
No known key found for this signature in database
GPG Key ID: 90A0EF1B8251A889

View File

@ -25,6 +25,11 @@ $(function () {
var keyC = 67;
var keyBackSpace = 8;
$(document).on('keyup', function (e) {
// is a string but is also a boolean according to https://api.jquery.com/prop/
if ($(e.target).prop('contenteditable') === 'true' || $(e.target).prop('contenteditable') === true) {
return;
}
if (e.target.nodeName === 'INPUT' || e.target.nodeName === 'TEXTAREA' || e.target.nodeName === 'SELECT') {
return;
}
@ -40,6 +45,11 @@ $(function () {
}
});
$(document).on('keydown', function (e) {
// is a string but is also a boolean according to https://api.jquery.com/prop/
if ($(e.target).prop('contenteditable') === 'true' || $(e.target).prop('contenteditable') === true) {
return;
}
// disable the shortcuts when session has timed out.
if ($('#modalOverlay').length > 0) {
return;