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 執行獨立重現,然後檢查針對缺少的 view、已卸載的頁面、正常取消、已完成的滑動和延遲取消所描述的回歸覆蓋。完成的標準是:在沒有先前已掛載頁面的情況下取消仍然安全,同時現有的清理作業和已完成的滑動仍可正常運作。
由索引模型根據 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 天 8 小時
- 30 天內合併 PR
- 80
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
ionic-team/ionic-framework 的其他 Issue
-
bug: input-otp, backspace in an empty box only moves focus instead of clearing the previous box可能已有人在做 @sarankumar1325 今天認領。 未關閉package: core type: bug
難度 2/5 1-3 小時 新手友好度 90/100
ionic-team/ionic-framework#31639 · 1 則留言 ·
維護者通常 1 天內回覆
-
bug: ion-searchbar input is always labelled "search text"; aria-label on the host is not forwarded可能已有人在做 @HappyKnuckles 於 18 天前認領。 未關閉a11y package: core type: bug
難度 2/5 1-3 小時 新手友好度 84/100
ionic-team/ionic-framework#31492 · 1 則留言 ·
維護者通常 1 天內回覆
-
bug: IonTabs throws when a Fragment contains one IonRouterOutlet可能已有人在做 @Benziza 於 59 天前認領。 未關閉package: react type: bug
難度 2/5 1-3 小時 新手友好度 72/100
ionic-team/ionic-framework#31410 · 2 則留言 ·
維護者通常 1 天內回覆
-
package: angular type: bug
難度 2/5 1-3 小時 新手友好度 86/100
ionic-team/ionic-framework#31291 · 1 則留言 ·
維護者通常 1 天內回覆
-
bug: ion-range: Clicking/Tapping on the Last tick doesn't work可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉triage
難度 2/5 1-3 小時 新手友好度 70/100
ionic-team/ionic-framework#30738 ·
維護者通常 1 天內回覆
查看 ionic-team/ionic-framework 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 85/100
MoonshotAI/kimi-code#4398 ·
維護者通常 1 天內回覆
-
pending triage
難度 2/5 1-3 小時 新手友好度 65/100
維護者通常 1 天內回覆
-
package-lock.json : les binaires natifs macOS et Linux de unrs-resolver ont disparu depuis #1823未關閉bug dependencies
難度 2/5 1-3 小時 新手友好度 70/100
AxaFrance/design-system#2064 ·
維護者通常 3 天內回覆
-
難度 2/5 1-3 小時 新手友好度 75/100
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 85/100