bug: ion-searchbar input is always labelled "search text"; aria-label on the host is not forwarded
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 84/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- accessibility, frontend
Hướng nghiên cứu
Bắt đầu trong core/src/components/searchbar/searchbar.tsx, tại mã xử lý các thuộc tính kế thừa quanh dòng 285 và input native quanh dòng 690. So sánh cách xử lý aria-label hiện có trong ion-input và ion-textarea, sau đó xác minh việc tái hiện với aria-label và aria-labelledby. Được xem là hoàn tất khi input native nhận các thuộc tính của host đó và vẫn sử dụng "search text" khi không thuộc tính nào trong hai thuộc tính này được cung cấp.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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 / v9.x (reproduced on 9.0.3)
Current Behavior
The native <input> rendered by ion-searchbar always carries aria-label="search text":
and the component inherits only lang and dir from the host:
So an aria-label (or aria-labelledby) placed on <ion-searchbar> never reaches the input. A screen reader announces every searchbar as "search text, search field" — in English, whatever the app language, and without saying what the field searches (members, chats, messages, places…). ion-input and ion-textarea already forward aria-label from the host to the native control, so ion-searchbar is the odd one out.
Expected Behavior
ion-searchbar forwards aria-label / aria-labelledby from the host to its <input>, the way ion-input does, keeping "search text" as the fallback when the host sets neither.
Steps to Reproduce
- Render
<ion-searchbar aria-label="Search family members" placeholder="Search family members"></ion-searchbar>. - Inspect the rendered
input.searchbar-input, or focus it with VoiceOver / NVDA. - The input's accessible name is "search text"; the host's
aria-labelis ignored.
Code Reproduction URL
The three-line snippet above reproduces it in any Ionic app; the behaviour follows directly from the two source lines linked. Happy to add a StackBlitz if that helps triage.
Ionic Info
Ionic Framework 9.0.3, Angular 22 (standalone), Capacitor 8. Observed with iOS 18 VoiceOver and Chrome 140 + NVDA.
Additional Information
Our workaround is an Angular directive on ion-searchbar that, after render, copies the host placeholder onto input.searchbar-input as aria-label. I would be glad to open a PR that adds aria-label / aria-labelledby to the inherited attributes and passes them to the input, falling back to "search text".
- Ngôn ngữ chính
- TypeScript
- Star
- 52.7k
- Fork
- 13.3k
- Merge trung bình
- 3 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 55
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của ionic-team/ionic-framework
-
triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ionic-team/ionic-framework#31410 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ionic-team/ionic-framework#31314 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
ionic-team/ionic-framework#31291 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
ionic-team/ionic-framework#30738 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
package: core type: bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
ionic-team/ionic-framework#29864 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của ionic-team/ionic-framework
Issue tương tự
-
Mend: dependency security vulnerability untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
opensearch-project/security-dashboards-plugin#2545 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add: Dream TR SDĐang mởcheck:passed streams:add
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
doctor integrity sample scans soft-deleted pages on Postgres (batch path has no deleted_at filter)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
SocialGouv/egapro#4672 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
area:agents area:tui bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
anthropics/claude-code#98358 ·
Maintainer thường phản hồi trong vòng 1 ngày