ionic-team / ionic-team/ionic-framework

feat: customize where modal is appended to

Đang mở
#24,198 17 bình luận 14 reaction 0 người được giao Xem trên GitHub
package: core type: feature request
Ngôn ngữ chính
TypeScript
Star
52.7k
Fork
13.3k
Merge trung bình
1 ngày 15 giờ
Pull request đã merge (30 ngày)
51

Mô tả

### Prerequisites

- [X] I have read the [Contributing Guidelines](https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#creating-an-issue).
- [X] I agree to follow the [Code of Conduct](https://ionicframework.com/code-of-conduct).
- [X] I have searched for [existing issues](https://github.com/ionic-team/ionic-framework/issues) that already include this feature request, without success.

### Describe the Feature Request

Specifying the parent component for a modal.

Similar requests:
https://github.com/ionic-team/ionic-framework/issues/22689
https://github.com/ionic-team/ionic-framework/issues/23250

### Describe the Use Case

I'm attempting to use the new sheet modal within a map UI. The problem is, the map is not the only feature of my app - it's a "tab" within my app.

If I launch a sheet modal within the map tab, it covers my tab bar. It'd be nice to be able to tie the sheet model to that specific tab, so that users can still navigate tabs while having a location / sheet modal active on the map tab.

### Describe Preferred Solution

Perhaps there could be a ModalOption to allow for specifying the parent component, which by default would be `ion-app`?

### Describe Alternatives

I'm not aware of any other way to do this within the current framework version 6.RC.2

### Related Code
https://github.com/ionic-team/ionic-framework/blob/61be8aa140c38338b94b2234d732bab67e431093/core/src/utils/overlays.ts#L59-L60

### Additional Information
_No response_

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

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

Hướng nghiên cứu

Start with core/src/utils/overlays.ts around lines 59-60 and review the related issues linked in the request. Determine how a modal could target a parent component instead of ion-app, then verify that the proposed behavior supports sheet modals within a tab while preserving existing default behavior.

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

Đánh giá

Công nghệ
typescript
Lĩnh vực
frontend
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
25/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.