fix(packages): only remove aria-hidden when an accessibility prop is set (#5347)

* Adjust accessibility behaviour for title elements

* Adjust angular package as well

* Fix types

* fix(packages/angular): use fixture.whenStable instead of triggering change detection manually

detectChanges() explicitly forces a check, so it can mask missing automatic change detection

* test(packages/angular): add test for non-signal bound aria attribute

* fix(angular): preserve explicit aria-hidden and support input bindings

---------

Co-authored-by: Karsa <contact@karsa.org>
This commit is contained in:
Eric Fennis
2026-12-01 12:56:09 +01:00
committed by GitHub
co-authored by Karsa
parent 475eff7532
commit 8cd4f293f2
31 changed files with 570 additions and 53 deletions
+6 -2
View File
@@ -23,12 +23,16 @@ Only if an icon **conveys essential meaning on its own** should it be made acces
## Making an Icon Accessible
To expose an icon to assistive technologies, provide an accessible name by binding the `title` input of the icon component.
To expose an icon to assistive technologies, provide an accessible name by binding the `title` input of the icon component, or by setting an `aria-label` attribute on it.
This removes the `aria-hidden` attribute and makes the icon visible to screen readers.
Setting the `title` input, or any `aria-*` or `role` attribute, stops the icon from being hidden from screen readers.
```angular-html
<svg lucideHouse title="This is my house" />
<!-- or -->
<svg lucideHouse aria-label="This is my house" />
```
Choose a label that clearly describes the meaning of the icon or the action it represents in the context of your application.