-
Notifications
You must be signed in to change notification settings - Fork 27.4k
ngAria - incorrect "aria-checked" and "tabindex" applied to checkbox/radio #10212
Comments
@DmitryEfimenko I think I agree with you - it looks like pretty much broken atm... It looks like a deliberate choice, though, looking at this test: angular.js/test/ngAria/ariaSpec.js Lines 463 to 482 in 5b23bc9
@arbus @marcysutton could you guys please help me understand this test? The way I'm reading it is it disables keyboard navigation with tab on non-selected elements which is pretty non-intuitive. Or is the test backward? |
That looks like a valid bug to me @DmitryEfimenko and @pkozlowski-opensource! ngAria is attempting to make custom controls accessible, and causing a bug on native inputs (I just saw that in your Plunker). See this Plunker showing the custom implementation: http://plnkr.co/edit/AP1Ts8ArjeREksp77xb6?p=preview To create this, I started with the ngModel Checkbox Demo on the ngAria Developer Guide and simply swapped out the role from On the Angular Material radio button, for example, we put |
@marcysutton thnx for your input - this starts to get interesting! Now, I must admit that my knowledge about aria-related topics is very limited (shame on me!) but it looks like there sth to fix here. |
@pkozlowski-opensource I just updated my answer because I looked at the original Plunker in this issue: ngAria is totally causing a bug on native inputs. I'm working on a PR for #10012, so I can look into it. |
@marcysutton @pkozlowski-opensource @DmitryEfimenko This looks like the bug is at https://github.com/angular/angular.js/blob/master/src/ngAria/aria.js#L231. In the original plnkr example, the We can verify this by just switching An easy fix for this is to convert the |
@arbus go for it! It looks like there is a bug with the existing implementation. Thank you! |
Fix for angular#10212. Compare the string value of the model so that aria-checked will be properly applied to type=radio in the case where the model is a number Closes angular#10212
Fix for angular#10212. Compare the string value of the model so that aria-checked will be properly applied to type=radio in the case where the model is a number Closes angular#10212
Make sure the checked attribute is set correctly for: - checkboxes with string and integer models using ngTrueValue / ngFalseValue - radios with integer models - radios with boolean models using ngValue Fixes angular#10389 Fixes angular#10212
Make sure the checked attribute is set correctly for: - checkboxes with string and integer models using ngTrueValue / ngFalseValue - radios with integer models - radios with boolean models using ngValue Fixes angular#10389 Fixes angular#10212
Make sure the checked attribute is set correctly for: - checkboxes with string and integer models using ngTrueValue / ngFalseValue - radios with integer models - radios with boolean models using ngValue Fixes angular#10389 Fixes angular#10212
Make sure the checked attribute is set correctly for: - checkboxes with string and integer models using ngTrueValue / ngFalseValue - radios with integer models - radios with boolean models using ngValue Fixes angular#10389 Fixes angular#10212
Hello angular team!
Overview of the Issue - incorrect attributes
aria-checked
andtabindex
are applied to the input of typeradio
: when radio is selected, the following attributes are applied:aria-checked="false"
,tabindex="-1"
.Motivation for or Use Case - radio button never gets selected when pressing Tab
Angular Version(s) - 1.3.1 for all modules
Browsers and Operating System - Chrome 38.0.2125.111 m. Haven't tested in other browsers, but pretty sure it'll be the same.
Reproduce the Error - see Plunker.
Related Issues - not found
Suggest a Fix - Switching attribute
value
tong-value
fixes the issue, but it is inconsistent through out the angular's logic - it was able to figure out that the radio should be selected with the regularvalue
attribute, but it could not figure out correct accessibility attributes. It appears the issue has to do with the following lines of codeThe text was updated successfully, but these errors were encountered: