-
Notifications
You must be signed in to change notification settings - Fork 27
Description
Bug Description
The mapPadding prop on NavigationView behaves inconsistently across platforms. On iOS, it correctly accepts values in density-independent points (dp/pt), but on Android it appears to expect raw pixel values instead.
This forces consumers to manually multiply padding values by the device's pixel ratio on Android:
const pixelRatio = Platform.OS === 'android' ? PixelRatio.get() : 1;
const mapPadding = {
bottom: Math.round(sheetHalfHeight * pixelRatio),
};
<NavigationView mapPadding={mapPadding} />Expected Behavior
mapPadding should accept density-independent points on both platforms, consistent with how all other React Native layout values work. The SDK should handle the dp-to-pixel conversion internally on Android, so consumers can simply write:
const mapPadding = {
bottom: sheetHalfHeight,
};Current Behavior
On Android, passing dp values (e.g. from a React Native layout measurement) results in incorrect/too-small padding. You must manually multiply by PixelRatio.get() to get the correct result. On iOS, the same dp values work correctly without any conversion.
Environment
- SDK version: 0.14.1
- Platform: Android (iOS works correctly)
- React Native: 0.76+