callstack / callstack/react-native-paper

apply safe area insets to menu

オープン
#4,709 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug Menu
主要言語
TypeScript
スター
14.5k
フォーク
2.2k
平均マージ
5日 23時間
マージ済み PR(30日)
12

説明

### 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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

additionalVerticalValue が計算されている src/components/Menu/Menu.tsx の 447〜451 行付近から始めます。ノッチのある iPhone で大きな Menu コンポーネントを使って問題を再現し、その後、アンカーの上と下の両方に開くメニューが、重なりや意図しない隙間なく safe-area insets を尊重することを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
react-native, typescript
領域
frontend, mobile
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
48/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。