ionic-team / ionic-team/ionic-framework
feat: need a way of knowing when swipe to go back is aborted
- 主要语言
- TypeScript
- 星标
- 52.7k
- 派生
- 13.3k
- 平均合并
- 1 天 15 小时
- 30 天内合并 PR
- 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_
贡献指南
调研方向
Start with the Ionic lifecycle documentation linked in the issue and trace the navigation and animation flow behind ionViewWillLeave, ionViewDidLeave, ionViewWillEnter, and ionViewDidEnter. Determine where a canceled swipe is distinguishable from completed navigation, then verify that the chosen lifecycle behavior is consistent for both entering and leaving views.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- typescript
- 领域
- frontend, mobile-dev
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 42/100