From 1fe42c6b3880d595d6ec467f07322ad58a0fbf19 Mon Sep 17 00:00:00 2001 From: Kilian Finger Date: Thu, 17 Oct 2024 20:30:45 +0200 Subject: [PATCH] fix: allow resetting contentInset with 0 (#468) * fix: allow resetting contentInset with 0 * docs: update changelog * fix: pass contentInset properly to native view --- CHANGELOG.md | 2 ++ javascript/components/MapView.tsx | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cdf3b3297..1ca91cb5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ PR Title ([#123](link to my pr)) ``` +fix: allow resetting contentInset with 0 ([#468](https://github.com/maplibre/maplibre-react-native/pull/468)) + ## 10.0.0-alpha.21 fix: Call requestProgress when getting pack status on IOS + example improvement [#445](https://github.com/maplibre/maplibre-react-native/pull/445) diff --git a/javascript/components/MapView.tsx b/javascript/components/MapView.tsx index 857abc16f..43fbbd46e 100644 --- a/javascript/components/MapView.tsx +++ b/javascript/components/MapView.tsx @@ -760,7 +760,7 @@ const MapView = memo( }; const contentInsetValue = useMemo(() => { - if (!props.contentInset) { + if (props.contentInset === undefined) { return; } @@ -812,7 +812,7 @@ const MapView = memo( surfaceView, regionWillChangeDebounceTime, regionDidChangeDebounceTime, - contentInsetValue, + contentInset: contentInsetValue, style: styles.matchParent, }; }, [ @@ -825,7 +825,6 @@ const MapView = memo( surfaceView, regionWillChangeDebounceTime, regionDidChangeDebounceTime, - contentInsetValue, props, contentInsetValue, ]);