callstack / callstack/react-native-paper

apply safe area insets to menu

Đang mở
#4,709 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug Menu
Ngôn ngữ chính
TypeScript
Star
14.5k
Fork
2.2k
Merge trung bình
5 ngày 23 giờ
Pull request đã merge (30 ngày)
12

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu trong src/components/Menu/Menu.tsx, khoảng các dòng 447-451, nơi additionalVerticalValue được tính toán. Tái hiện vấn đề với một component Menu lớn trên iPhone có notch, sau đó xác minh rằng các menu mở cả phía trên và phía dưới anchor của chúng đều tuân theo safe-area insets mà không bị chồng lấp hoặc tạo ra khoảng trống ngoài ý muốn.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
react-native, typescript
Lĩnh vực
frontend, mobile
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
48/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.