ionic-team / ionic-team/ionic-framework

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

Offen
#21,979 3 Kommentare 9 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
package: core type: feature request
Vorherrschende Sprache
TypeScript
Sterne
52.7k
Forks
13.3k
Ø Merge
1 T. 15 Std.
Gemergte PRs (30 T.)
51

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.