Skip to content

Commit

Permalink
Fix close not working from fullscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
WithoutPants committed Sep 24, 2023
1 parent a11637d commit f6520a1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ui/v2.5/src/hooks/Lightbox/Lightbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -319,12 +319,12 @@ export const LightboxComponent: React.FC<IProps> = ({
});

const close = useCallback(() => {
if (!isFullscreen) {
hide();
document.body.style.overflow = "auto";
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(Mousetrap as any).unpause();
} else document.exitFullscreen();
if (isFullscreen) document.exitFullscreen();

hide();
document.body.style.overflow = "auto";
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(Mousetrap as any).unpause();
}, [isFullscreen, hide]);

const handleClose = (e: React.MouseEvent<HTMLDivElement>) => {
Expand Down

0 comments on commit f6520a1

Please sign in to comment.