ionic-team / ionic-team/ionic-framework

feat: return data from modal even when not explicitly calling dismiss method

Đang mở
#21,979 3 bình luận 9 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ả

# Feature Request

**Ionic version:**

[x] **5.x**

**Describe the Feature Request**

My App currently displays a list with various items. The user can click on an item and edit it in a modal. When the modal dismisses, the list should show the changes the user had made.
I can use `this.modalCtrl.dismiss(value);` only if the user clicks on the "save" button. But I also want to pass the edited object to the previous page when the user swipes down to close the modal or clicks on the backdrop.

**Describe Preferred Solution**

A good solution would be an event that will be triggered if the modal is is going to be dismissed. A good example is the calendar app: https://streamable.com/7etj0s
This event could be used to prevent the modal from closing and show some info to the user. This event could also be used to trigger `this.modalCtrl.dismiss(value);` and pass data to page by using swipe-to-close.

**Describe Alternatives**

I tried to call `this.modalCtrl.dismiss(value);` in ionViewWillLeave. But the passed object was undefined.

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

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

Đánh giá

Issue này chưa được đánh giá.

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.