#54 Avoid quick search hotkey if input is focused

This commit is contained in:
Serraniel 2020-09-30 20:08:39 +02:00
parent 2ce76e3300
commit 1c57d1f45c
Signed by: Serraniel
GPG key ID: 3690B4E7364525D3

View file

@ -64,7 +64,12 @@ function handleQuickSearch(event) {
function handleSearchForShiftF(event) {
if (helper.isShiftPressed) {
if (event.key === 'F') {
// check if some kind of input is focused already; we then prevent our hotkey
if (document.activeElement instanceof HTMLInputElement || document.activeElement.isContentEditable) {
return;
}
if (event.code === 'KeyF') {
event.preventDefault();
document.getElementById(quickSearchID).focus();
}