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 1 year 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

Hey @alex-fournier, thank you for your pull request 🤗. The documentation from this branch can be viewed here.

callstack-bot avatar Sep 13 '24 12:09 callstack-bot

In 66b8bfd1a14e253bdf419214a12c2b97eb9dcf9e, I fixed the component name of Menu and Card for the documentation website. (Menu vs. MenuComponent and Card vs. CardComponent)

Capture d’écran 2024-09-13 à 15 03 05

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