Skip to content

[Bug]: mapPadding on Android requires raw pixels instead of density-independent points #541

@christian-apollo

Description

@christian-apollo

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+

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions