diff options
author | Ridley Combs <rcombs@rcombs.me> | 2025-08-19 06:25:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-08-19 06:25:42 -0700 |
commit | 492378692776d21925fa3507034088371f712c16 (patch) | |
tree | d9300df24bb3d47d146da0d059b07864b97cf40c /src/view | |
parent | 48baf7277df4b447521d372db9ca3f7f3ca7b73b (diff) | |
download | voidsky-492378692776d21925fa3507034088371f712c16.tar.zst |
[Lightbox] prevent browser-default escape key behavior (#8859)
Some browsers exit fullscreen when the escape key is pressed without `preventDefault()` being called; we don't want that when we're handling the press ourselves.
Diffstat (limited to 'src/view')
-rw-r--r-- | src/view/com/lightbox/Lightbox.web.tsx | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/view/com/lightbox/Lightbox.web.tsx b/src/view/com/lightbox/Lightbox.web.tsx index 97811da7f..ab50fbcf0 100644 --- a/src/view/com/lightbox/Lightbox.web.tsx +++ b/src/view/com/lightbox/Lightbox.web.tsx @@ -76,6 +76,7 @@ function LightboxInner({ const onKeyDown = useCallback( (e: KeyboardEvent) => { if (e.key === 'Escape') { + e.preventDefault() onClose() } else if (e.key === 'ArrowLeft') { onPressLeft() |