-
Notifications
You must be signed in to change notification settings - Fork 27.3k
feat(ngAria): add an ngAria module to make a11y easier #9157
Conversation
Adds various aria attributes to the built in directives. This module currently hooks into ng-show/hide, input, textarea button as a basic level of support for a11y. I am using this as a base for adding more tags into the mix for form direction flow, making ng-repeat updates atomic but the tags here are the most basic ones. Closes angular#5486 and angular#1600
This is awesome! LGTM |
Landed as d1434c9. |
👍 👍 👍 Yay! |
Hi Brian, |
yep, on it. |
return { | ||
watchExpr: watchExpr, | ||
ariaChecked: watchExpr('ngModel', 'ariaChecked'), | ||
ariaDisabled: watchExpr('ngDisabled', 'ariaDisabled'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be removed from the service as only used by ngDisabled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could aria-disabled
be managed by ngDisabled
itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could. Actually for most of these cases here and it would be even faster.
The idea was that we don't want to add more code to Angular core for people that don't need aria support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Who doesn't need ARIA support? :) I think many times people incorrectly assume their audience won't need it. If the framework can improve accessibility by default, it's a huge win. That said, it is important to not impact performance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think by "don't need" tobias means "don't need angular to automatically do this." There are plenty of existing angular apps that have existing a11y strategies, for which this would be extra code weight.
I made some significant refactors to #8342, notably: