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: focus-trapped-within-menuitem #17550

Conversation

preetibansalui
Copy link
Contributor

@preetibansalui preetibansalui commented Sep 23, 2024

Closes #17277

Focus trapped in menuItem of menuButton

Changelog

Changed

place e.preventDefault to required condition only instead of whole focus method.

Testing / Reviewing

To test focus trapped issue

  1. Go to Storybook> MenuButton> Default
  2. Open the menuButton and press tab key - it should change the focus to next tabable element.

To test Scroll issue

  1. Go to Storybook> MenuButton> ExperimentalAutoAlign
  2. Open the menuButton and press up/down arrow keys, it should not scroll the page.

Copy link

netlify bot commented Sep 23, 2024

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 0ba2fb4
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/66f10bbf2555410008354569
😎 Deploy Preview https://deploy-preview-17550--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Sep 23, 2024

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 0ba2fb4
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/66f10bbf6eb95300082d6b99
😎 Deploy Preview https://deploy-preview-17550--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Sep 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.03%. Comparing base (a9bddc8) to head (0ba2fb4).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #17550   +/-   ##
=======================================
  Coverage   77.03%   77.03%           
=======================================
  Files         408      408           
  Lines       13992    13992           
  Branches     4300     4300           
=======================================
  Hits        10779    10779           
  Misses       3040     3040           
  Partials      173      173           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@2nikhiltom 2nikhiltom left a comment

Choose a reason for hiding this comment

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

Awesome ! This avoids keyboard navigation to cause page scroll too

@kennylam kennylam added this pull request to the merge queue Sep 25, 2024
Merged via the queue into carbon-design-system:main with commit afc2c6a Sep 25, 2024
36 checks passed
@carbon-automation
Copy link
Contributor

Hey there! v11.67.0 was just released that references this issue/PR.

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.

[a11y][MenuButton]: Focus Trapped Within MenuItem List in MenuButton Component
3 participants