react-native-paper icon indicating copy to clipboard operation
react-native-paper copied to clipboard

fix(menu): dropdown position with translucent status bar

Open alex-fournier opened this issue 5 months ago • 2 comments

This PR replaces the way the status bar height is calculated on Android. Now I use react-native-safe-area-context to get the top inset. The old way using NativeModules.NativeUnimoduleProxy?.modulesConstants was no longer working since this commit in Expo: https://github.com/expo/expo/pull/28014/files

I removed the expo-constants dependency as it was only used for the old way of calculating status bar height that has been removed.

Motivation

The initial problem was an incorrect position of the menu under the anchor when using anchorPosition=bottom with a translucent status bar in Android.

Related issue

#4493

Test plan

I added a test case in the example app. A menu with anchor position set to bottom. It is displayed the same, either with a status bar translucent or not.

alex-fournier avatar Sep 13 '24 12:09 alex-fournier