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

report(accessibility): make dropdown match ARIA action menu button pattern #9433

Merged
merged 1 commit into from
Aug 15, 2019

Conversation

johnemau
Copy link
Contributor

@johnemau johnemau commented Jul 22, 2019

Summary
This improves the accessibility of the report dropdown by adding ARIA attributes and interactive behavior in-line with the WCAG menu button pattern, specifically the navigation menu button.

Screenshot of NVDA speech view + the dropdown
evenmore-improved-dropdown-NVDA

Screenshot of button accessibility tree
dd-button-accessibility-tree-open

Screenshot of menu item accessibility tree
dd-menuitem-accessibility-tree

Gif of keyboard interactions
audits-dropdown

This will meet WCAG success criteria 1.3.1 Info and Relationship and 4.1.2 Name, Role, Value

Related Issues/PRs
#9183

Copy link
Contributor Author

@johnemau johnemau left a comment

Choose a reason for hiding this comment

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

I think this is a step in the right direction, I just need some project guidance on the best way to implement UI controls (in JS) or try to keep state in the DOM.

Copy link
Collaborator

@connorjclark connorjclark left a comment

Choose a reason for hiding this comment

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

IDK about the accessibility stuff, but I commented on what I do know about :)

@patrickhulce patrickhulce changed the title report(accessibility): Make dropdown match AIRA action menu button pattern report(accessibility): Make dropdown match ARIA action menu button pattern Jul 24, 2019
@johnemau
Copy link
Contributor Author

Quick update

I am working on feedback and will have changes ready for another round of review early next week.

@johnemau
Copy link
Contributor Author

IDK about the accessibility stuff, but I commented on what I do know about :)

I have implemented the requested feedback, PTAL @connorjclark

@johnemau
Copy link
Contributor Author

ping @connorjclark, @patrickhulce

@johnemau
Copy link
Contributor Author

PTAL @paulirish

Copy link
Collaborator

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @johnemau!

onToolsDropDownKeydown(e) {
const el = /** @type {?HTMLElement} */ (e.target);

switch (e.code) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

could reorder and fall thru these cases

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea, I will get that in tomorrow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I took a closer look at this and was not able to reorder the cases to allow fall thrus, the issue I hit was ArrowUp/Down require a start element and Home/End should not have a start element.

Let me know if I missed something, thanks!

Copy link
Member

@paulirish paulirish left a comment

Choose a reason for hiding this comment

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

this impl looks fine in general.

after we land this tomorrow would you be willing to do a small followup which refactors the toolsButton/toolsDropdown into a separate class?

the class could remain here in the same file.. it'd just be nice to separate things a bit, now that this has grown.

cheers.

@johnemau
Copy link
Contributor Author

this impl looks fine in general.

Thanks for the review!

after we land this tomorrow would you be willing to do a small followup which refactors the toolsButton/toolsDropdown into a separate class?

You got it! I have the refactor started in a branch and will open the PR once this is merged.

@connorjclark connorjclark changed the title report(accessibility): Make dropdown match ARIA action menu button pattern report(accessibility): make dropdown match ARIA action menu button pattern Aug 15, 2019
@connorjclark connorjclark merged commit 69ce8ef into GoogleChrome:master Aug 15, 2019
@johnemau
Copy link
Contributor Author

after we land this tomorrow would you be willing to do a small followup which refactors the toolsButton/toolsDropdown into a separate class?

@paulirish, as requested: #9564

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants