bug: vue swipe cancellation throws when the previous page is missing
维护者通常 1 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript, typescript
- 领域
- frontend, mobile-dev
调研方向
从 Ionic Vue IonRouterOutlet 的取消分支 swipeHandler.onEnd(false) 开始,重点检查通过 findViewItemByRouteInfo 进行的查找。使用 npm install 和 npm run dev 运行独立复现,然后检查针对缺失视图、已卸载页面、正常取消、已完成滑动和延迟取消所描述的回归覆盖。完成的标准是:在没有之前已挂载页面的情况下取消操作仍然安全,同时现有清理逻辑和已完成的滑动仍能正常工作。
由索引模型根据 Issue 内容生成。
描述
Prerequisites
- I have read the contributing guidelines and code of conduct.
- I have searched existing issues for this problem.
Ionic Framework Version
v9.x
Current Behavior
Ionic Vue's IonRouterOutlet cancellation branch (swipeHandler.onEnd(false)) unconditionally dereferences the view returned by findViewItemByRouteInfo and its ionPageElement.
If the callback runs after navigation has returned to a root route, there may be no previous view in that outlet. The callback throws:
TypeError: Cannot read properties of undefined (reading 'ionPageElement')
The same branch also throws if a view record exists but its page has been unmounted. This was observed in an iOS app using 9.0.3, with the stack pointing to the cancelled-animation callback in the core router outlet. The unguarded code is still present on main at 643584b3ac2ba1ca263cbf53960ccde3be2a96fc (9.0.6).
Expected Behavior
Cancellation should safely do nothing if there is no previous mounted page to hide. When the page exists, cancellation should continue setting aria-hidden="true" and ion-page-hidden. Completed swipes should continue navigating back.
Steps to Reproduce
- Download the four files in the reproduction gist into one directory.
- Run
npm installandnpm run devwith a supported Node version. - Open the displayed local URL and click Reproduce.
- Observe the TypeError in the page and console.
The reproduction uses the real Ionic Vue router and outlet. It pushes a second page, checks canStart(), returns to the first page, then explicitly delivers onEnd(false) to model a late cancellation callback. This is a deterministic callback-level reproduction, not a claim to reproduce the physical touch/animation race. There are no mocked view stacks or routers.
Code Reproduction URL
https://gist.github.com/dandoingdev/d7a6e044bf006bdb633aa32aaeffd410
Environment
Standalone reproduction: @ionic/vue 9.0.6, @ionic/vue-router 9.0.6, Vue 3.5.42, Vue Router 5.3.1, Vite 8.3.0. Confirmed in headless Chrome on macOS. No Ionic CLI or Capacitor is needed for the deterministic reproduction.
Additional Information
I have prepared a small guard for the missing view/page and regression tests, and will link the PR here. Tests cover missing views, unmounted pages, normal cancellation cleanup, completed swipes, and late cancellation after returning to the root using the real router.
- 主要语言
- TypeScript
- 星标
- 52.7k
- 派生
- 13.3k
- 平均合并
- 2 天 11 小时
- 30 天内合并 PR
- 55
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ionic-team/ionic-framework 的其他 Issue
-
bug: ion-searchbar input is always labelled "search text"; aria-label on the host is not forwarded可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭triage
难度 2/5 1-3 小时 新手友好度 84/100
ionic-team/ionic-framework#31492 ·
维护者通常 1 天内回复
-
bug: IonTabs throws when a Fragment contains one IonRouterOutlet可能已有人在做 @Benziza 于 41 天前认领。 未关闭triage
难度 2/5 1-3 小时 新手友好度 72/100
ionic-team/ionic-framework#31410 · 1 条评论 ·
维护者通常 1 天内回复
-
triage
难度 2/5 1-3 小时 新手友好度 72/100
ionic-team/ionic-framework#31314 ·
维护者通常 1 天内回复
-
triage
难度 2/5 1-3 小时 新手友好度 86/100
ionic-team/ionic-framework#31291 ·
维护者通常 1 天内回复
-
triage
难度 2/5 1-3 小时 新手友好度 70/100
ionic-team/ionic-framework#30738 ·
维护者通常 1 天内回复
查看 ionic-team/ionic-framework 的全部 Issue
相似的 Issue
-
triage
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
agent-ready area: config area: skills type: chore upstream: brain-kit
难度 1/5 1 小时以内 新手友好度 95/100
-
enhancement priority:low ready-for-dev
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
bug escritorio mapa
难度 2/5 1-3 小时 新手友好度 72/100
marcosferr/reporte-ciudadano#4 · 1 条评论 ·
-
area: material/sort gemini-triaged needs triage
难度 2/5 1-3 小时 新手友好度 70/100
angular/components#33933 ·
维护者通常 1 天内回复