Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

fix(datagrid): add an aria-label to the column chooser dialog #5195

Merged
merged 1 commit into from
Nov 4, 2020

Conversation

amellnik
Copy link
Contributor

Add an aria-label to the column chooser dialog.

Closes: #4754

Signed-off-by: Alex Mellnik a.r.mellnik@gmail.com

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • If applicable, have a visual design approval

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • clarity.design website / infrastructure changes
  • Other... Please describe:

What is the current behavior?

The column chooser dialog has the dialog role, but there's no label associated with it. There is a invisible div inside the dialog that describes it, but since it's not an aria-label its not read again as the screen reader virtual focus exits the dialog.

What is the new behavior?

Removes the invisible div and moves the message to the aria-label of the dialog.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Add an aria-label to the column chooser dialog.

Closes: vmware-archive#4754

Signed-off-by: Alex Mellnik <a.r.mellnik@gmail.com>
Comment on lines -46 to -48
<div class="clr-sr-only" tabindex="-1" #menuDescription>
{{ commonStrings.keys.showColumnsMenuDescription }}
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

Where does this and related removals come from? I can't find them as part of the linked issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Previously, the description for the column toggle panel was being done with this invisible div that was programatically focused when the column chooser was opened. The problem with this is that while it's read when the panel is opened, when the user exits the panel the screen reader will tell them that they have exited a dialog but not what dialog it was that they exited. This change moves the description to the dialog itself so that it's read both when the user enters it and leaves it.

There's still another one of these invisible divs in the dialog after this change, but a better way of handling that would probably to use the Angular CDK's aria-live service rather than trying to get the same effect by shifting focus to an invisible div.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good. Btw, we're staying away from making our own aria-live implementations or services, because we don't want to impose any such implementations to the user. So, your solution is more in sync with our current strategy. I like it when code gets removed.

@amellnik
Copy link
Contributor Author

If you found this helpful I'd appreciate it if you would add the hacktoberfest-accepted -- I'm attempting to mine a shirt. Thanks -A

@hippee-lee hippee-lee added the hacktoberfest Issues that can be worked on as part of the Hackoberfest label Oct 29, 2020
@Jinnie
Copy link
Contributor

Jinnie commented Oct 30, 2020

I've not forgotten this PR, I am trying to fix in parallel some other related issues with the same dialog and I want to see what interference might there be both ways.

Copy link
Contributor

@Jinnie Jinnie left a comment

Choose a reason for hiding this comment

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

OK, I don't think it will be conflicting with the other changes I'll be doing here.
Looks good to me, too.

@Jinnie Jinnie merged commit a7aa0f8 into vmware-archive:next Nov 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
hacktoberfest Issues that can be worked on as part of the Hackoberfest hacktoberfest-accepted type: accessibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Screen Reader dialog boundaries are not communicated for datagrid show/hide column
4 participants