Skip to content

Commit e8314be

Browse files
committed
Only let "/" be a shortcut for search if the page overall has focus NOT an input. Fixes #81
1 parent deb3e41 commit e8314be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

switchboard/admin/index.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,7 @@
863863
});
864864
865865
window.addEventListener("keydown", (e) => {
866-
if (!$('input[type=search]').is(':focus') && (e.code === 'F3' || e.code === 'Slash' || ((e.ctrlKey || e.metaKey) && e.code === 'KeyF'))) {
866+
if (!$('input[type=search]').is(':focus') && (e.code === 'F3' || (e.code === 'Slash' && document.activeElement === document.body) || ((e.ctrlKey || e.metaKey) && e.code === 'KeyF'))) {
867867
e.preventDefault();
868868
$('input[type=search]').focus();
869869
}

0 commit comments

Comments
 (0)