callstack / callstack/react-native-paper
apply safe area insets to menu
- Lenguaje dominante
- TypeScript
- Estrellas
- 14.5k
- Forks
- 2.2k
- Merge medio
- 5 d 23 h
- PR fusionados (30 d)
- 12
Descripción
### Current behaviour
When I have a large component in a Menu, it can go out of the safe-area-view going behind the statusbar and the notch (photos below).
### Expected behaviour
Menu should consider the SafeArea Insets when calculating the available space to show the menu on Top.
### How to reproduce?
Render a large enough component in a Menu and scroll to a point that including the statusbar/notch there's enough space on top of the anchor.
The menu opens on top and goes under the statusbar/notch.
### Preview
iPhone 13 mini:
### What have you tried so far?
Adding SafeArea Top Inset value to the `additionalVerticalValue` calculated here fixes the issue:
https://github.com/callstack/react-native-paper/blob/beab66e074e2b0dfa1251ae221308178003d4a9b/src/components/Menu/Menu.tsx#L447-L451
**Although** after doing this, when the menu opens below the anchor, it has a space from anchor equal to the top-inset, so more changes are needed to correctly apply the insets.
### Your Environment
| software | version
| --------------------- | -------
| ios | 18.1
| android | SDK 34
| react-native | 0.76.9
| react-native-paper | 5.13.3
| node | v22.12.0
| npm or yarn | yarn 4.7.0
| expo sdk | ~52.0.46
Guía de contribución
Línea de trabajo
Start in src/components/Menu/Menu.tsx around lines 447-451, where additionalVerticalValue is calculated. Reproduce the issue with a large Menu component on a notched iPhone, then verify that menus opening both above and below their anchors respect the safe-area insets without overlap or an unintended gap.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- react-native, typescript
- Área
- frontend, mobile
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 48/100