fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

SpinButton: A11y Pass

Open TestAccessibilityGIT opened this issue 8 years ago • 20 comments

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-valuetext is specified, assistive technologies render that instead of the value of aria-valuenow." So it's correct that aria-valuenow is 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

TestAccessibilityGIT avatar Nov 26 '18 22:11 TestAccessibilityGIT

@jspurlin Just an fyi there are SpinButton accessibility issues here, could you take a look? (I believe Boris originally wrote this.)

dzearing avatar Nov 27 '18 21:11 dzearing

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

jspurlin avatar Dec 10 '18 22:12 jspurlin

:tada:This issue was addressed in #7969, which has now been successfully released as [email protected].:tada:

Handy links:

msft-github-bot avatar Feb 13 '19 13:02 msft-github-bot

@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!

aneeshack4 avatar Feb 13 '19 20:02 aneeshack4

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.

aneeshack4 avatar Feb 13 '19 20:02 aneeshack4

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: image

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: image

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. image

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.

aneeshack4 avatar Mar 05 '19 21:03 aneeshack4

@TestAccessibilityGIT Please do not comment with the outlook emails... it's very unnecessary & makes issues long and hard to read.

aneeshack4 avatar Mar 05 '19 21:03 aneeshack4

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 avatar Mar 05 '19 22:03 aneeshack4

@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 avatar Mar 06 '19 07:03 v-doku

@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 avatar Mar 06 '19 20:03 aneeshack4

@aneeshack4 referring to the same spec .

image

Also referring to this (https://www.w3.org/TR/wai-aria-1.1/#spinbutton) it says aria-valuenow attribute is a must for spinbutton.

v-doku avatar Mar 07 '19 06:03 v-doku

aria-valuenow IS already set in SpinButton.tsx: image 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.

aneeshack4 avatar Mar 07 '19 06:03 aneeshack4

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.

image

Due to which K4W tool is throwing below error.

image

Also below screenshot which mentions mandatory attribute.

image

v-doku avatar Mar 07 '19 06:03 v-doku

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.

aneeshack4 avatar Mar 07 '19 07:03 aneeshack4

I think the above code has still not gone live because can't see that attribute in code as of now on my end.

v-doku avatar Mar 07 '19 07:03 v-doku

It is live: https://github.com/OfficeDev/office-ui-fabric-react/blob/master/packages/office-ui-fabric-react/src/components/SpinButton/SpinButton.tsx#L185

aneeshack4 avatar Mar 07 '19 07:03 aneeshack4

:tada:This issue was addressed in #8202, which has now been successfully released as [email protected].:tada:

Handy links:

msft-github-bot avatar Mar 08 '19 13:03 msft-github-bot

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!

just-joshing avatar Aug 07 '19 23:08 just-joshing

@JllyGrnGiant I'll Teams you the internal stack overflow link.

aneeshack4 avatar Aug 07 '19 23:08 aneeshack4

Thank you!

just-joshing avatar Aug 07 '19 23:08 just-joshing