Skip to content

Commit d2a63c2

Browse files
committed
Fix FullScreenControl container (#1430)
1 parent dbbb2ce commit d2a63c2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/components/fullscreen-control.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ function FullscreenControl(props) {
5151
const [mapboxFullscreenControl, createMapboxFullscreenControl] = useState(null);
5252

5353
useEffect(() => {
54-
const container = props.container || context.container;
55-
56-
const control = new mapboxgl.FullscreenControl({container});
54+
const control = new mapboxgl.FullscreenControl();
5755

5856
createMapboxFullscreenControl(control);
5957
setShowButton(control._checkFullscreenSupport());
@@ -75,6 +73,7 @@ function FullscreenControl(props) {
7573

7674
const onClickFullscreen = () => {
7775
if (mapboxFullscreenControl) {
76+
mapboxFullscreenControl._container = props.container || context.container;
7877
mapboxFullscreenControl._onClickFullscreen();
7978
}
8079
};

0 commit comments

Comments
 (0)