mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +00:00
KeyboardNavigation prevented when text input focused
This commit is contained in:
parent
838ad18f9f
commit
a89e04192f
1 changed files with 9 additions and 7 deletions
|
|
@ -2,11 +2,15 @@ function KeyboardNavigation() {
|
|||
let active = false;
|
||||
|
||||
function onKeyDown(event) {
|
||||
if (event.keyboardNavigationPrevented) {
|
||||
if (event.keyboardNavigationPrevented || event.target.tagName === 'INPUT') {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (event.code) {
|
||||
case 'Digit0': {
|
||||
window.location = '#/search';
|
||||
break;
|
||||
}
|
||||
case 'Digit1': {
|
||||
window.location = '#/';
|
||||
break;
|
||||
|
|
@ -28,12 +32,10 @@ function KeyboardNavigation() {
|
|||
break;
|
||||
}
|
||||
case 'Backspace': {
|
||||
if (event.target.tagName !== 'INPUT') {
|
||||
if (event.ctrlKey) {
|
||||
window.history.forward();
|
||||
} else {
|
||||
window.history.back();
|
||||
}
|
||||
if (event.ctrlKey) {
|
||||
window.history.forward();
|
||||
} else {
|
||||
window.history.back();
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in a new issue