fix(Search): fullscreen shortcut interference

This commit is contained in:
Timothy Z. 2025-06-30 13:09:04 +03:00
parent 0b16f1c80e
commit 066819d283

View file

@ -42,11 +42,21 @@ const useFullscreen = () => {
};
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) {
exitFullscreen();
}
if (event.code === 'KeyF') {
if (event.code === 'KeyF' && !inputFocused) {
toggleFullscreen();
}