#54 Avoid quick search hotkey if input is focused #60

Merged
Serraniel merged 1 commit from bugfix/#54-quick-search-hot-key-triggers-when-text-input-is-focused into develop 2020-10-01 21:34:09 +02:00

View file

@ -64,7 +64,12 @@ function handleQuickSearch(event) {
function handleSearchForShiftF(event) { function handleSearchForShiftF(event) {
if (helper.isShiftPressed) { 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(); event.preventDefault();
document.getElementById(quickSearchID).focus(); document.getElementById(quickSearchID).focus();
} }