ionic-team / ionic-team/ionic-framework

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

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

説明

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

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

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

評価

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

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

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