Skip to content

Commit

Permalink
v7
Browse files Browse the repository at this point in the history
  • Loading branch information
aliraza556 committed Aug 11, 2024
1 parent c6838da commit 537c78b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/ui/fullscreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,20 @@ export class Fullscreen {
event.preventDefault();
}
});

document.addEventListener('fullscreenchange', () => {
if (isAppInNativeFullscreenMode()) {
document.addEventListener('keydown', this.preventEscHandler, true);
} else {
document.removeEventListener('keydown', this.preventEscHandler, true);
}
});
}

private preventEscHandler(event: KeyboardEvent) {
if (event.key === 'Escape') {
event.preventDefault();
}
}
}

Expand Down

0 comments on commit 537c78b

Please sign in to comment.