[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.
This commit is contained in:
Ridley Combs
2025-08-19 06:25:42 -07:00
committed by GitHub
parent 48baf7277d
commit 4923786927
+1
View File
@@ -76,6 +76,7 @@ function LightboxInner({
const onKeyDown = useCallback(
(e: KeyboardEvent) => {
if (e.key === 'Escape') {
e.preventDefault()
onClose()
} else if (e.key === 'ArrowLeft') {
onPressLeft()