Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Make "Expand all" button more screen-reader friendly #3665

Merged
merged 3 commits into from
Nov 19, 2020

Conversation

DaveTryon
Copy link
Contributor

Description of changes

Issue #3539 suggests an improvement to the Expand all/Collapse all button when read via a screen reader. Specifically, set the aria-label property to a more descriptive value when the button is in the collapsed state. The issue says nothing about modifying the aria-label property in the expanded state. Change has been validated with NVDA in both Web and Unified clients.

HTML of the button in the collapsed state (aria-label property is new)

<button type="button" aria-expanded="false" aria-label="Expand all rules to show failed instances." class="ms-Button ms-Button--action ms-Button--command expand-collapse-all-button--3fwBF root-113" data-is-focusable="true"><span class="ms-Button-flexContainer flexContainer-108" data-automationid="splitbuttonprimary"><i data-icon-name="ChevronRight" role="presentation" aria-hidden="true" class="ms-Icon root-37 css-60 ms-Button-icon icon-114" style="font-family: FabricMDL2Icons;"></i><span class="ms-Button-textContainer textContainer-109"><span class="ms-Button-label label-57" id="id__18">Expand all</span></span></span></button>

HTML of the button in the expanded state (no aria-label is added, and button is unchanged from before):

<button type="button" aria-expanded="true" class="ms-Button ms-Button--action ms-Button--command expand-collapse-all-button--3fwBF root-113" data-is-focusable="true"><span class="ms-Button-flexContainer flexContainer-108" data-automationid="splitbuttonprimary"><i data-icon-name="ChevronDown" role="presentation" aria-hidden="true" class="ms-Icon root-37 css-60 ms-Button-icon icon-114" style="font-family: FabricMDL2Icons;"></i><span class="ms-Button-textContainer textContainer-109"><span class="ms-Button-label label-57" id="id__18">Collapse all</span></span></span></button>

Pull request checklist

  • Addresses an existing issue: Expand/ Collapse All button could be more descriptive #3539
  • Ran yarn fastpass
  • Added/updated relevant unit test(s) (and ran yarn test)
  • Verified code coverage for the changes made. Check coverage report at: <rootDir>/test-results/unit/coverage
  • PR title AND final merge commit title both start with a semantic tag (fix:, chore:, feat(feature-name):, refactor:). See CONTRIBUTING.md.
  • (UI changes only) Added screenshots/GIFs to description above
  • (UI changes only) Verified usability with NVDA/JAWS

@DaveTryon DaveTryon requested a review from a team as a code owner November 18, 2020 00:48
@DaveTryon
Copy link
Contributor Author

DaveTryon commented Nov 18, 2020

@ferBonnin, can you please clarify whether or not the aria-label is supposed to be modified when the button is expanded? If so, what should the intended aria-label text be?

Copy link
Contributor

@JGibson2019 JGibson2019 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but waiting for confirmation from Fer about aria-label for expanded state

@ferBonnin
Copy link
Contributor

@ferBonnin, can you please clarify whether or not the aria-label is supposed to be modified when the button is expanded? If so, what should the intended aria-label text be?

No changes required in the label for when the button is expanded. We can keep the same behaviour we have currently.

@DaveTryon DaveTryon merged commit 260e9d5 into microsoft:master Nov 19, 2020
@DaveTryon DaveTryon deleted the ExpandCollapseButton branch November 19, 2020 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants