ion-icon without a label is exposed as an image with no name
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 84/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- typescript, web-dev
- Bereich
- accessibility, frontend
Rechercherichtung
Das Issue verweist auf icon.tsx auf main; lies zunächst nach, wie role und ARIA-Attribute des Hosts gerendert werden. Prüfe, ob es bereits Accessibility-Tests gibt, und verifiziere anschließend, dass ein Icon ohne aria-label oder aria-labelledby für assistive Technologien verborgen ist, während ein beschriftetes Icon ein Bild bleibt. Das Issue nennt keine Testdatei; suche daher den relevanten Test, bevor du ihn ausführst.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Current behaviour
ion-icon always renders role="img" on its host. When no aria-label is given, which is the usual
case for an icon next to text, screen readers meet an image with no name. axe reports this as
role-img-alt. One app we scanned had 54 of these across three pages.
Apps can add aria-hidden="true" to each decorative icon, but that is easy to miss, and the default is
the inaccessible case.
Steps to reproduce
- Add
<ion-icon name="logo-github"></ion-icon>to a page, with noaria-label. - Inspect the accessibility tree: the icon is an image with no name.
- Or run axe's
role-img-altrule.
Seen with ionicons 8.0.13. icon.tsx on main renders role="img" on the host the same way.
Expected behaviour
An ion-icon with no aria-label or aria-labelledby is hidden from assistive technology, as Angular
Material's mat-icon does by default.
Possible fix
Set aria-hidden="true" on the host when neither aria-label nor aria-labelledby is present, and
leave role="img" for labelled icons.
Related: #710 and #838 (closed), about labels being forced.
Happy to open a PR for this if you'd like one.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 18.2k
- Forks
- 2k
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus ionic-team/ionicons
-
triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 67/100
ionic-team/ionicons#1520 ·
-
triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 73/100
ionic-team/ionicons#1519 ·
-
icon request: PillOffentriage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
ionic-team/ionicons#1516 ·
-
bug: Invalid @supports syntax in icon.css breaks under strict CSS parsers (e.g. Lightning CSS)Evtl. vergeben @johnjenkins hat das vor 74 Tagen übernommen. Offentriage
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 92/100
ionic-team/ionicons#1513 ·
-
triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
ionic-team/ionicons#1510 ·
Alle Issues in ionic-team/ionicons
Ähnliche Issues
-
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 86/100
ranxianglei/billion-context#5893 ·
Maintainer antworten meist innerhalb von 1 Tag
-
stringify escapes leading digits in pseudo-class arguments (:nth-child(1) becomes :nth-child(\31 ))Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 83/100
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement security severity:low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 83/100
Battle-Cattle/BCUK-Bot-4#959 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Bug]: Claude account rows no longer show the email (since #8055), so "Account 1, 2, 3" cannot be told apartEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offenaccount-pool bug gui
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
lidge-jun/opencodex#8286 · 2 Kommentare · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag