SpinButton: A11y Pass
Tracking all of the issues brought up with the 11/22 accessibility pass on Spin control Details on individual bugs can be found on SharePoint
- [x] ~~Bug 1: [Accessibility][Keyboard Navigation]: 'Required aria' attribute must be provided for the 'Spin Button with custom implementation' spin button.~~ According to the ARIA spec: "If
aria-valuetextis specified, assistive technologies render that instead of the value ofaria-valuenow." So it's correct thataria-valuenowis not provided. - [x] Bug 2: [Accessibility][Programmatic access]: 'Up/down' Buttons must have discernible text. Fixed in PR #7969
- [x] Bug 3: [Accessibility][Functional]: User is allowed to enter the values in 'Spin Button with custom implementation' edit box out of the defined range i.e.'0-100'. Weirdness with text as value, explained in comment below but fixed with PR #8202
- [x] ~~Bug 4: [Accessibility][Screen reader]: No need to have scan mode focus on 'Up/down' buttons as values can be changed using up/down arrow keys.~~ We already have role="presentation" on these icons which should serve to hide this element from ATs. Moreover, this is standard Narrator scan mode behavior - as far as I know, we can't do anything more to hide it from ATs. Also, with my fix to Bug 2, the potential for user frustration should be taken care of because now the buttons are announced clearly as "increase/decrease value by step"
- [x] Bug 5: [Accessibility][Usable]: Narrator speaks spin button information multiple times. Contacted Narrator team about this behavior because we're setting the right labels - Narrator's just picking up on them twice
- [x] Bug 6: [Accessibility][Usable]: User is not able to type in edit box as Scan mode does not get turn off when focus comes on edit field spin button. Narrator bug - reached out to them & they're tracking it
- [x] Bug 7: [Accessibility][Programmatic access]: 'Up/down' buttons of spin button should get disabled at its minimum and maximum value. Feature request
- [x] Bug 8: [Accessibility][Usable]: In Scan mode narrator does not convey the 'Decimal spin button' information properly. Contacted Narrator team about this behavior because we're setting the right labels - Narrator's just rounding the first announcement to the first decimal place Though it does read it out the value in full without any rounding in the 2nd announcement.
Component: Spin @micahgodbolt
@jspurlin Just an fyi there are SpinButton accessibility issues here, could you take a look? (I believe Boris originally wrote this.)
Bug 1: [Accessibility][Keyboard Navigation]: 'Required aria' attribute must be provided for the 'Spin Button with custom implementation' spin button. Why does this need aria-required? It doesn't require user input before something can be submitted...
Bug 2: [Accessibility][Programmatic access]: 'Up/down' Buttons must have discernible text. They have programatic access to that functionality via up/down arrow, at most the buttons should have aria-hidden="true" so that ATs won't see them
Bug 3: [Accessibility][Functional]: User is allowed to enter the values in 'Spin Button with custom implementation' edit box out of the defined range i.e.'0-100'. This sounds like a bug with that demo spinButton
Bug 4: [Accessibility][Screen reader]: No need to have scan mode focus on 'Up/down' buttons as values can be changed using up/down arrow keys. Again, this could be fixed by setting aria-hidden="true" on the buttons in the spinButton
Bug 5: [Accessibility][Usable]: Narrator speaks spin button information multiple times. This sounds like a Narrator issue. We should follow up with their team
Bug 6: [Accessibility][Usable]: User is not able to type in edit box as Scan mode does not get turn off when focus comes on edit field spin button. This would be a Narrator issue. Narrator should automatically exit scan mode when focus goes into an edit field
Bug 7: [Accessibility][Programmatic access]: 'Up/down' buttons of spin button should get disabled at its minimum and maximum value. ...Sure, although if they are aria-hidden then they won't be seen by ATs so this would just a be feature request
Bug 8: [Accessibility][Usable]: In Scan mode narrator does not convey the 'Decimal spin button' information properly. I get the correct information being conveyed with Narrator in scan mode
:tada:This issue was addressed in #7969, which has now been successfully released as [email protected].:tada:
Handy links:
@TestAccessibilityGIT I've contacted Narrator about Bugs 5, 6, and 7 and cc'd you - please don't respond to Github comments with Outlook though! It just makes these issues unnecessarily long and unreadable. If you could please respond directly on Github to us from now on all issues, we'd really appreciate it, thanks!
It got auto-closed by the bot - I'm still trying to find a fix for Bugs 1 & 3. There's some weirdness with aria-valuenow in the stateful example because the value is not just a number, it includes text.
Circling back to this - looked into Bug 3 again and it looks like a bug with assistive technologies & how they deal with aria-valuetext and aria-valuenow.
According to the ARIA spec:

In the Stateful example, the presence of the metric "cm" in text form means the value is not just a number so aria-valuetext must be used according to the ARIA spec:

The other problem with this Stateful example is that value is not changing in Inspect, only aria-valuetext is. For the other examples, aria-valuenow is set and is changing with the updates to the input but with the Stateful example, as you can see below, the value stays default (7 cm) while the aria-valuetext chagnes.

There was some weirdness with usage of aria-valuetext with Slider too which might explain why this is example's not updating. I tried everything I could to fix the example - adding a min & max, setting defaultValue, trying other aria attributes to get the value to update and be restricted to the range but no luck. So I'm going to close this out for now as it doesn't look like there's a workaround for it. If someone else finds it, it can be reopened.
@TestAccessibilityGIT Please do not comment with the outlook emails... it's very unnecessary & makes issues long and hard to read.
Turns out value not updating was an Edge-only bug :O Chrome doesn't have this problem. I'll send out a PR with the fix now.
@aneeshack4 Regarding Bug1 it does not says about aria-required but aria-valuenow to be included in code. Please look in to the expected result column.
I guess confusion was caused due to 'required aria attribute' which is mentioned, which means a mandatory aria attribute(aria-valuenow) should be present for SpinButton
@v-doku Ah I see now K4W is complaining about aria-valuenow not being provided. Please read the comment above where I explain that this is correct behavior according to the Aria spec.
@aneeshack4 referring to the same spec .

Also referring to this (https://www.w3.org/TR/wai-aria-1.1/#spinbutton) it says aria-valuenow attribute is a must for spinbutton.
aria-valuenow IS already set in SpinButton.tsx:
Please read the whole spec if you look 2 paragraphs below what you marked in red, you'll see: "If aria-valuetext is specified, assistive technologies SHOULD render that value INSTEAD of the value of aria-valuenow." Which is why it's not provided.
The Url (https://uifabric-prod.azurewebsites.net/?example=jhkjhkj#/components/spinbutton) on which I am verifying this upon inspecting it does not has aria-valuenow attribute present in code please refer below screenshot.

Due to which K4W tool is throwing below error.

Also below screenshot which mentions mandatory attribute.

I see that K4W is throwing an error but this is following the ARIA spec because we are setting both aria-valuetext and aria-valuenow as you can see in the code screenshot above. I think Keros is erroring because like the ARIA spec says, ATs don't render aria-valuenow if aria-valuetext is set.
I think the above code has still not gone live because can't see that attribute in code as of now on my end.
It is live: https://github.com/OfficeDev/office-ui-fabric-react/blob/master/packages/office-ui-fabric-react/src/components/SpinButton/SpinButton.tsx#L185
:tada:This issue was addressed in #8202, which has now been successfully released as [email protected].:tada:
Handy links:
Hi @aneeshack4 Do you have a link to an external bug/issue filed on the Microsoft Edge team for bug 5? Our team has an accessibility bug assigned to us for our use of the Office Fabric spin button and we cannot resolve it as an external issue without linking an external issue/bug.
Thanks!
@JllyGrnGiant I'll Teams you the internal stack overflow link.
Thank you!