-
Notifications
You must be signed in to change notification settings - Fork 27.4k
[ngAria] aria-required only applied when ng-model has $error.required #11374
Comments
A native input doesn't need |
So this works as expected @marcysutton? |
Unless I'm missing something, it looked like it worked fine to me. @dpogue can you elaborate? Is the issue happening when |
@dpogue can you reply to this issue? Otherwise we'll close it as not a bug. |
My concern was just that the |
According to this mdn example, it looks like So, for non-native inputs (controls) with ng-model that have a required attribute should this mean?
|
That sounds right. Upon looking closer, I found that <some-checkbox type="checkbox" ng-required="true" ng-model="data">
Checkbox
</some-checkbox> {
"type": "checkbox",
"ng-model": "data",
"ng-required": "true",
"tabindex": "0",
"required": "required",
"aria-checked": "false",
"aria-required": "true"
} By including With <some-checkbox role="checkbox" show-attrs ng-model="data" required>
Checkbox
</some-checkbox> {
"role": "checkbox",
"ng-model": "data",
"ng-required": "true",
"class": "ng-pristine ng-untouched ng-valid",
"tabindex": "0",
"required": "required",
"aria-checked": "true",
"aria-required": "false"
} Pretty much exactly the same thing happens with |
BREAKING CHANGE: Where appropriate, ngAria now applies ARIA to custom controls only, not native inputs. Because of this, support for `aria-multiline` on textareas has been removed. New support added for ngValue, ngChecked, and ngRequired, along with updated documentation. Closes angular#13078 Closes angular#11374 Closes angular#11830
BREAKING CHANGE: Where appropriate, ngAria now applies ARIA to custom controls only, not native inputs. Because of this, support for `aria-multiline` on textareas has been removed. New support added for ngValue, ngChecked, and ngRequired, along with updated documentation. Closes angular#13078 Closes angular#11374 Closes angular#11830
BREAKING CHANGE: Where appropriate, ngAria now applies ARIA to custom controls only, not native inputs. Because of this, support for `aria-multiline` on textareas has been removed. New support added for ngValue, ngChecked, and ngRequired, along with updated documentation. Closes angular#13078 Closes angular#11374 Closes angular#11830
BREAKING CHANGE: Where appropriate, ngAria now applies ARIA to custom controls only, not native inputs. Because of this, support for `aria-multiline` on textareas has been removed. New support added for ngValue, ngChecked, and ngRequired, along with updated documentation. Closes angular#13078 Closes angular#11374 Closes angular#11830
BREAKING CHANGE: Where appropriate, ngAria now applies ARIA to custom controls only, not native inputs. Because of this, support for `aria-multiline` on textareas has been removed. New support added for ngValue, ngChecked, and ngRequired, along with updated documentation. Closes angular#13078 Closes angular#11374 Closes angular#11830
Based on a Twitter conversation with @marcysutton: https://twitter.com/dpogue/status/569999089967849472
If I have
<input type="text" ng-model="username" name="username" required>
and I'm using ngAria then it should have thearia-required
attribute added to it.This currently only happens when the field doesn't have content (i.e., when
username.$error.required
is true):https://github.com/angular/angular.js/blob/master/src/ngAria/aria.js#L292-L298
The text was updated successfully, but these errors were encountered: