Skip to content

Commit

Permalink
fix(maps): browser fullscreen is not supported by Safari for iPhone
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtemSBulgakov committed Oct 11, 2024
1 parent 153228e commit 49e6601
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/maps/MapView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ export function MapView({ scene }: { scene: mapsTypes.SchemaScene }) {

// Set fullscreen mode when the fullscreen state changes
useEffect(() => {
// requestFullscreen and exitFullscreen are not supported on iPhone Safari
if (fullscreen) {
document.body.requestFullscreen();
document.body.requestFullscreen?.();
} else {
document.exitFullscreen();
document.exitFullscreen?.();
}
}, [fullscreen]);

Expand Down

0 comments on commit 49e6601

Please sign in to comment.