fix: stop topic navigation hotkeys from firing if in a mousetrap-enabled form element

This commit is contained in:
Julian Lam
2022-10-20 21:59:29 -04:00
parent 5ba818ba7b
commit 5c9fe6c0fd

View File

@@ -89,7 +89,11 @@ define('forum/topic', [
});
}
mousetrap.bind('j', () => {
mousetrap.bind('j', (e) => {
if (e.target.classList.contains('mousetrap')) {
return;
}
const index = navigator.getIndex();
const count = navigator.getCount();
if (index === count) {
@@ -99,7 +103,11 @@ define('forum/topic', [
navigator.scrollToIndex(index, true, 0);
});
mousetrap.bind('k', () => {
mousetrap.bind('k', (e) => {
if (e.target.classList.contains('mousetrap')) {
return;
}
const index = navigator.getIndex();
if (index === 1) {
return;