Skip to content

Commit 6721467

Browse files
authored
fix: prevent the escape key from minimizing Safari (#265)
* fix: prevent the escape key from minimizing Safari Safari uses the escape key as a shortcut for exiting full screen. Stopping propagation is _not_ enough to prevent this behaviour. Use `preventDefault` instead of `stopPropagation` to avoid messing with the users' browser experience. Closes: #264 * fix: stop propagation in addition to preventing default
1 parent 74bdfb6 commit 6721467

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/InternalEvents.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ function useToggleHandler() {
4242
Escape: (event: KeyboardEvent) => {
4343
if (showing) {
4444
event.stopPropagation();
45+
event.preventDefault();
4546
options.callbacks?.onClose?.();
4647
}
4748

0 commit comments

Comments
 (0)