ionic-team / ionic-team/ionic-framework

feat: need a way of knowing when swipe to go back is aborted

Aperta
#28,929 19 commenti 4 reazioni 0 assegnatari Vedi su GitHub
package: core type: feature request
Lingua principale
TypeScript
Stelle
52.7k
Fork
13.3k
Merge medio
1g 15h
PR unite (30g)
51

Descrizione

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

Currently we have four primary `ionView[Did/Will][Enter/Leave] events to observe during navigation & animation. However, there are scenarios where these events may be fired, but the user cancels the action and stays on the current screen. There does not seem to be a way to detect this scenario, unless I am missing something.

Existing events: https://ionicframework.com/docs/angular/lifecycle

I would like to be able to observe `ionViewDidNotEnter` and `ionViewDidNotLeave` events (or something to that effect), so that we can understand when users started to leave the page, but did not.

### Describe the Use Case

On iOS, as an example, a user swipes right to go back to the previous page, then decides to stay on the page they're looking at. However, `ionViewWillLeave` has been called, and the current page has taken some action that needs to be rolled back when the animation finishes. For the sake of this use case, it is not possible to use the `ionViewDidLeave` event for what the page needs to do.

Unless I've missed a feature or event to observe, we need supplemental events to know when this situation occurs.

### Describe Preferred Solution

Publish `ionViewDidNotEnter` and `ionViewDidNotLeave` events to supplement the existing ones we already have.

### Describe Alternatives

Not sure.

### Related Code

_No response_

### Additional Information

_No response_

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.