bug: ion-menu focuses its full-screen host on open and does not restore focus to ion-menu-button on close; ion-menu-button reads aria-label only once
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 45/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 技術堆疊
- typescript
研究方向
The issue identifies ion-menu focus handling and ion-menu-button label updates, but names no Ionic source files or tests. Start by locating those components and their existing accessibility tests, then reproduce the reported open, close, and runtime label changes. Done when focus moves to the visible menu on open, returns to the opener on close, and updated labels are reflected.
由索引模型根據 Issue 內容生成。
描述
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
v8.x
Current Behavior
- When an
ion-menuis closed with the keyboard (Escape or a close button inside the menu),
the menu blurs the focused element and does not return focus to theion-menu-buttonthat
opened it. The focus lands on<body>; a keyboard or screen reader user has to start over
from the top of the page. Measured on Android 14 (Chromium WebView) and iOS 26 (WKWebView). ion-menu-buttonreads itsaria-labelonce (inheritAttributes on load). When the app
changes the label at runtime (language switch), the button keeps the old name until the
next page is rendered, whileion-menuitself picks up a newaria-labelimmediately.- Without an app-provided label the button and the menu are announced with the English
defaults ("menu", "Navigation. In menu") regardless of the document language. - When the menu opens,
ion-menumoves focus to its own host element (afterAnimationcalls
this.el.focus()withtabindex="0"set inbeforeAnimation). The host has
role="navigation"and covers the whole viewport (left/right/top/bottom: 0, backdrop
included), so TalkBack draws its focus frame around the entire screen instead of the visible
menu panel and announces only the landmark name. Measured on Android 14 (Chromium WebView,
TalkBack): after opening,document.activeElementis theion-menuhost.
Verified with the reproduction on Ionic 8.8.5 (Chrome 154, page "2 ion-menu focus"): after closing the menu
document.activeElement is <body>; after changing the host aria-label to "Open menu" the inner button still
carries "Menü öffnen".
Expected Behavior
- Closing the menu restores focus to the element that opened it, as
ion-modal,
ion-popoverandion-alertdo. aria-labelchanges onion-menu-buttonare reflected.- Opening the menu focuses the visible menu panel (
.menu-inner) or its first focusable
element, so the screen reader focus matches what is visible.
Steps to Reproduce
- Closing the menu restores focus to the element that opened it, as
ion-modal,
ion-popoverandion-alertdo. aria-labelchanges onion-menu-buttonare reflected.- Opening the menu focuses the visible menu panel (
.menu-inner) or its first focusable
element, so the screen reader focus matches what is visible.
Code Reproduction URL
https://stackblitz.com/github/mrambow/starterApp/tree/a11y-repros (page /repro/menu)
GitHub: https://github.com/mrambow/starterApp/tree/a11y-repros (src/app/repros/menu.page.ts)
Code Reproduction URL
https://github.com/mrambow/starterApp/tree/a11y-repros
Ionic Info
Ionic 8.8.5, Angular 17.3, Capacitor 6 (reproduction); found in Ionic 8.8.5, Angular 21, Capacitor 8
Additional Information
No response
- 主要語言
- TypeScript
- 星號
- 52.7k
- 分支
- 13.3k
- 平均合併
- 2 天 22 小時
- 30 天內合併 PR
- 75
環境準備
- 沒有 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 於 12 天前認領。 未關閉package: core type: bug
難度 2/5 1-3 小時 新手友好度 90/100
ionic-team/ionic-framework#31639 · 1 則留言 ·
維護者通常 1 天內回覆
-
bug: vue swipe cancellation throws when the previous page is missing可能已有人在做 @dandoingdev 於 35 天前認領。 未關閉package: vue type: bug
難度 2/5 1-3 小時 新手友好度 78/100
ionic-team/ionic-framework#31514 · 1 則留言 ·
維護者通常 1 天內回覆
-
bug: ion-searchbar input is always labelled "search text"; aria-label on the host is not forwarded可能已有人在做 @HappyKnuckles 於 30 天前認領。 未關閉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 於 71 天前認領。 未關閉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 天內回覆
查看 ionic-team/ionic-framework 的全部 Issue
相似的 Issue
-
Navbar avatar and name stay stale after saving profile changes可能已有人在做 @alexechoi 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 76/100
marmelab/atomic-crm#416 ·
維護者通常 1 天內回覆
-
feature-request
難度 2/5 1-3 小時 新手友好度 66/100
bluesky-social/social-app#12343 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
lucide-icons/lucide#5165 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 64/100
marktext/marktext#6033 · 1 則留言 ·
維護者通常 1 天內回覆
-
area:desktop bug has repro platform:macos
難度 2/5 1-3 小時 新手友好度 62/100
anthropics/claude-code#107903 ·