diff --git a/src/ui/handler/scroll_zoom.js b/src/ui/handler/scroll_zoom.js index c3e3e1556c7..5f27fc8f75c 100644 --- a/src/ui/handler/scroll_zoom.js +++ b/src/ui/handler/scroll_zoom.js @@ -398,7 +398,7 @@ class ScrollZoomHandler { } _isFullscreen(): boolean { - return !!window.document.fullscreenElement; + return !!window.document.fullscreenElement || !!window.document.webkitFullscreenElement; } _showBlockerAlert() { diff --git a/test/unit/ui/handler/scroll_zoom.test.js b/test/unit/ui/handler/scroll_zoom.test.js index f3b4f9e938e..cd533f77831 100644 --- a/test/unit/ui/handler/scroll_zoom.test.js +++ b/test/unit/ui/handler/scroll_zoom.test.js @@ -455,6 +455,20 @@ test('When cooperativeGestures option is set to true, scroll zoom is activated w t.end(); }); +test('When cooperativeGestures option is set to true, scroll zoom is not prevented when map is fullscreen', (t) => { + window.document.fullscreenElement = true; + const map = createMapWithCooperativeGestures(t); + + const zoomSpy = t.spy(); + map.on('zoom', zoomSpy); + + simulate.wheel(map.getCanvas(), {type: 'wheel', deltaY: -simulate.magicWheelZoomDelta}); + map._renderTaskQueue.run(); + + t.equal(zoomSpy.callCount, 1); + t.end(); +}); + test('Disabling scrollZoom removes scroll zoom blocker container', (t) => { const map = createMapWithCooperativeGestures(t);