feat: Add ariaLabel property to icon component#3244
Merged
avinashbot merged 2 commits intomainfrom Feb 5, 2025
Merged
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3244 +/- ##
==========================================
+ Coverage 96.42% 96.44% +0.01%
==========================================
Files 790 791 +1
Lines 22322 22568 +246
Branches 7255 7792 +537
==========================================
+ Hits 21524 21765 +241
- Misses 791 796 +5
Partials 7 7 ☔ View full report in Codecov by Sentry. |
8eaf2d3 to
4a66db6
Compare
8abf280 to
7103c0b
Compare
7103c0b to
33c1fcf
Compare
georgylobko
reviewed
Feb 5, 2025
georgylobko
approved these changes
Feb 5, 2025
Member
Author
|
Just wanted to be sure before merging, dry-run build (7222839735) is successful. |
georgylobko
pushed a commit
that referenced
this pull request
Feb 18, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Motivation
If you want to have an accessible label for your icon (assuming you don't have visible text next to it), you currently have to do this:
Boo! Annoying! The current approach feels manual and seriously lacks discoverability - people can't find an
ariaLabelproperty, and sometimes end up (understandably) misusing thealtproperty. We could really just let people do this instead:This alone doesn't fix the fact that
altis still confusing, so I also deprecatedalt(ariaLabelwill be used if provided, but we'll still fall back to "alt" for<img>only).Related links, issue #, if available: n/a
How has this been tested?
Unit tests. Ignore all the force pushes, I was too lazy to run unit tests on my laptop.
Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
CONTRIBUTING.md.CONTRIBUTING.md.Security
checkSafeUrlfunction.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.