Skip to content

SplitButton: Add aria-roledescription#5062

Merged
dzearing merged 3 commits intomicrosoft:masterfrom
jspurlin:jspurlin/SplitButtonAddAriaRoleDescription
Jun 2, 2018
Merged

SplitButton: Add aria-roledescription#5062
dzearing merged 3 commits intomicrosoft:masterfrom
jspurlin:jspurlin/SplitButtonAddAriaRoleDescription

Conversation

@jspurlin
Copy link
Copy Markdown
Contributor

@jspurlin jspurlin commented Jun 1, 2018

Pull request checklist

  • Addresses an existing issue: Fixes #0000
  • Include a change request file using $ npm run change
  • Microsoft Alias (if you have one): jspurlin

Description of changes

With aria 1.1 there's an aria-roledescription (see: https://www.w3.org/TR/wai-aria-1.1/#aria-roledescription) which is there to help the user understand what a component is. Buttons (and any other componet that uses htmlProperties) can use it. The splitButton is built up slightly differently and needs it explicitly defined.

There's no harm if the attribute is not there and there's no harm if a screen reader does not read that content, it just gives the user a better chance to understand the components if an AT conveys that information

Focus areas to test

Verified that splitButtons top level and within menus can now get aria-roledescription and it reads out great in Edge/Narrator. Verified that not having the attribute does nothing and that normal buttons can also define this property if they so choose.

Microsoft Reviewers: Open in CodeFlow

jspurlin added 2 commits June 1, 2018 11:05
…can leverage that markup if it gets passed in to the component.
@jspurlin jspurlin requested a review from christiango June 1, 2018 18:23
@jspurlin jspurlin requested a review from joschect as a code owner June 1, 2018 18:23
@JasonGore
Copy link
Copy Markdown
Member

The spec you linked mentions the same element should also have 'role' defined (or implicitly defined) but I don't see it explicitly defined in the button output. Is it implicitly defined? I'm curious what an audit tool would say, have you run one? Thanks

@jspurlin
Copy link
Copy Markdown
Contributor Author

jspurlin commented Jun 1, 2018

SplitButtons have role="button" or role="menuitem" depending on their context

@JasonGore
Copy link
Copy Markdown
Member

Do you know why it wouldn't appear in the snapshot output? That's odd...

@jspurlin
Copy link
Copy Markdown
Contributor Author

jspurlin commented Jun 1, 2018

I'm seeing it in the snapshot output:
image

@JasonGore
Copy link
Copy Markdown
Member

Sorry. I swear I expanded all of the output.

@dzearing dzearing merged commit 8c8d8fb into microsoft:master Jun 2, 2018
Markionium added a commit to Markionium/office-ui-fabric-react that referenced this pull request Jun 2, 2018
* master: (274 commits)
  Demo Page Refactor Part 1 (microsoft#5055)
  SplitButton: Add aria-roledescription (microsoft#5062)
  Add addins sketch toolkit link (microsoft#5052)
  Dropdown title (microsoft#4983)
  Allow for more control over event handling for keytips (microsoft#5064)
  Build time speed improvements (microsoft#4965)
  Coachmark: Positioning fixes (microsoft#4995)
  Applying package updates.
  Experiments/Nav component: display "show more" link only if there is atleast one hidden link (microsoft#5057)
  Add pointerup listener to exit keytip mode (microsoft#5051)
  Update PULL_REQUEST_TEMPLATE.md
  Update ISSUE_TEMPLATE.md
  Shimmer: resolve conflicts (microsoft#5034)
  Invalid ARIA attributes: Fix empty values (microsoft#5040)
  ComboBox: Correct invalid ARIA attributes. (microsoft#4873) (microsoft#5001)
  ComboBox: Fix submit pending value (microsoft#5048)
  FocusTrapZone - restore last focused descendant element (microsoft#4897)
  Applying package updates.
  Take 2 of the require.resolve change. This time using the "resolve" pkg (microsoft#5031)
  fixing webpack config to allow rush build to complete on a small VM (microsoft#5037)
  ...
Markionium added a commit to Markionium/office-ui-fabric-react that referenced this pull request Jun 3, 2018
* master: (111 commits)
  Moving a variable to be defined sooner so that it is there when failures occur.
  Fix icon imports (microsoft#5069)
  MessageBar: More visible HC color for dismiss and expand buttons (microsoft#5061)
  Fix DetailsList accessibility and add more ARIA hooks (microsoft#5066)
  Update jest (microsoft#5068)
  Demo Page Refactor Part 1 (microsoft#5055)
  SplitButton: Add aria-roledescription (microsoft#5062)
  Add addins sketch toolkit link (microsoft#5052)
  Dropdown title (microsoft#4983)
  Allow for more control over event handling for keytips (microsoft#5064)
  Build time speed improvements (microsoft#4965)
  Coachmark: Positioning fixes (microsoft#4995)
  Applying package updates.
  Experiments/Nav component: display "show more" link only if there is atleast one hidden link (microsoft#5057)
  Add pointerup listener to exit keytip mode (microsoft#5051)
  Update PULL_REQUEST_TEMPLATE.md
  Update ISSUE_TEMPLATE.md
  Shimmer: resolve conflicts (microsoft#5034)
  Invalid ARIA attributes: Fix empty values (microsoft#5040)
  ComboBox: Correct invalid ARIA attributes. (microsoft#4873) (microsoft#5001)
  ...
@microsoft microsoft locked as resolved and limited conversation to collaborators Aug 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants