ionic-team / ionic-team/ionic-framework

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

オープン
#21,979 コメント 3 件 リアクション 9 件 担当者 0 名 GitHub で見る
package: core type: feature request
主要言語
TypeScript
スター
52.7k
フォーク
13.3k
平均マージ
1日 15時間
マージ済み PR(30日)
51

説明

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

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

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

評価

この issue はまだ評価されていません。

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

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