mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-21 15:52:02 +00:00
fix(Search): fullscreen shortcut interference
This commit is contained in:
parent
0b16f1c80e
commit
066819d283
1 changed files with 11 additions and 1 deletions
|
|
@ -42,11 +42,21 @@ const useFullscreen = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const onKeyDown = (event: KeyboardEvent) => {
|
const onKeyDown = (event: KeyboardEvent) => {
|
||||||
|
|
||||||
|
const activeElement = document.activeElement as HTMLElement;
|
||||||
|
|
||||||
|
const inputFocused =
|
||||||
|
activeElement &&
|
||||||
|
(activeElement.tagName === 'INPUT' ||
|
||||||
|
activeElement.tagName === 'TEXTAREA' ||
|
||||||
|
activeElement.tagName === 'SELECT' ||
|
||||||
|
activeElement.isContentEditable);
|
||||||
|
|
||||||
if (event.code === 'Escape' && settings.escExitFullscreen) {
|
if (event.code === 'Escape' && settings.escExitFullscreen) {
|
||||||
exitFullscreen();
|
exitFullscreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.code === 'KeyF') {
|
if (event.code === 'KeyF' && !inputFocused) {
|
||||||
toggleFullscreen();
|
toggleFullscreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue