callstack / callstack/react-native-paper

Add keepMounted flag to Modal/Dialog

Đang mở
#4,267 0 bình luận 1 reaction 0 người được giao Xem trên GitHub
feature request
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ả

**Is your feature request related to a problem? Please describe.**
Yes. It would be nice to persist the content sent to a modal/dialog even after it is closed to improve rendering performance.

**Describe the solution you'd like**
The default behavior of mounting the content when the modal/dialog is visible and unmounting it on close animation is great. However, I would like a way to keep the content mounted regardless if it is open. Two options could exist:
1. `after-first` - After opening for the first time, mount the content and keep keep it mounted for subsequent opens
2. `always` - Eagerly mount the content right away and again keep it mounted

Proposing new flag `mountingBehavior` on modal/dialog of type: `'open-only' | 'after-first' | 'always'` defaulted to `'open-only'`

**Describe alternatives you've considered**
I'm in the process of creating a custom dialog to accomplish this.

**Additional context**
[MUI](https://mui.com/material-ui/api/modal/#modal-prop-keepMounted) has a `keepMounted` flag for this.

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

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

Hướng nghiên cứu

Bắt đầu bằng cách xác định các entry point của Modal và Dialog cùng hành vi mount hiện tại chỉ khi đang mở. Xem xét cách các giá trị mountingBehavior được đề xuất—open-only, after-first và always—nên áp dụng cho cả hai component. Được xem là hoàn tất khi giá trị mặc định mới giữ nguyên hành vi hiện có và mỗi tùy chọn được yêu cầu giữ content được mount như đã chỉ định.

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
mobile
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 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
45/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.