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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close contextual menu when focus leaves #4359

Conversation

bethcollins92
Copy link
Contributor

@bethcollins92 bethcollins92 commented Mar 8, 2022

Done

  • Close contextual menu when the focus leaves

Fixes #4284

QA

  • Open demo
  • Open the "Take action" contextual menu
  • Tab through the dropdown, check when the focus leaves the menu it closes
  • Compare this to live. See how the menu remains open after the focus leaves.

Check if PR is ready for release

If this PR contains Vanilla SCSS code changes, it should contain the following changes to make sure it's ready for the release:

  • PR should have one of the following labels to automatically categorise it in release notes:
    • Feature 馃巵, Breaking Change 馃挘, Bug 馃悰, Documentation 馃摑, Maintenance 馃敤.
  • Vanilla version in package.json should be updated relative to the most recent release, following semver convention:
    • if CSS class names are not changed it can be bugfix relesase (x.x.X)
    • if CSS class names are changed/added/removed it should be minor version (x.X.0)
    • see the wiki for more details
  • Any changes to component class names (new patterns, variants, removed or added features) should be listed on the what's new page.
  • Documentation side navigation should be updated with the relevant labels.

@webteam-app
Copy link

Demo starting at https://vanilla-framework-4359.demos.haus

@bethcollins92 bethcollins92 force-pushed the 4284-improve-contextual-menu-accessibility branch from db0b533 to d6a28b8 Compare March 15, 2022 17:11

setupAllContextualMenus('.p-contextual-menu');
setupAllContextualMenus('.p-contextual-menu--left');
setupAllContextualMenus('.p-contextual-menu--center');
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can do it in one call, separating selectors setupAllContextualMenus('.p-contextual-menu, .p-contextual-menu--left, .p-contextual menu--center').

But also, to avoid listing all the variants you could do:
setupAllContextualMenus('.p-contextual-menu, [class*="p-contextual-menu--"]')

Copy link
Contributor

@bartaz bartaz left a comment

Choose a reason for hiding this comment

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

LGTM, with little suggestion to consider

@bethcollins92 bethcollins92 merged commit 159db40 into canonical:main Mar 16, 2022
@bethcollins92 bethcollins92 deleted the 4284-improve-contextual-menu-accessibility branch March 16, 2022 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Contextual menu isn't accessible
3 participants