Skip to content

fix(combo-button): prevent hover from stealing focus - #23108

Open
arslansohail2001 wants to merge 4 commits into
carbon-design-system:mainfrom
arslansohail2001:fix/combo-button-focus
Open

fix(combo-button): prevent hover from stealing focus#23108
arslansohail2001 wants to merge 4 commits into
carbon-design-system:mainfrom
arslansohail2001:fix/combo-button-focus

Conversation

@arslansohail2001

@arslansohail2001 arslansohail2001 commented Aug 25, 2026

Copy link
Copy Markdown

Closes #22831

Fixes a bug where hovering over standard, non-submenu items in a ComboButton would cause them to unexpectedly steal focus because useHover was enabled on all items.

Changelog

Changed

  • Updated MenuItem to only enable the useHover hook if the item actually has children (i.e. is a submenu).
  • Added a regression test to ComboButton-test.js to ensure that hovering over a standard item does not trigger focus stealing.

Testing / Reviewing

  1. Pull this branch and run Storybook.
  2. Navigate to the ComboButton component.
  3. Open the menu and hover over the standard items inside.
  4. Verify that focus is no longer stolen or reset unexpectedly while the cursor rests on or moves between items.

Alternatively, review the newly added regression test in ComboButton-test.js.

PR Checklist

As the author of this PR, before marking ready for review, confirm you:

  • Reviewed every line of the diff
  • Updated documentation and storybook examples (Not applicable)
  • Followed the required v12 migration documentation for any code change that affects v12 (Does not affect v12 migration documentation)
  • Wrote passing tests that cover this change
  • Addressed any impact on accessibility (a11y)
  • Tested for cross-browser consistency
  • Validated that this code is ready for review and status checks should pass

@arslansohail2001
arslansohail2001 requested a review from a team as a code owner August 25, 2026 09:07
@netlify

netlify Bot commented Aug 25, 2026

Copy link
Copy Markdown

Deploy Preview for v12-carbon-react ready!

Name Link
🔨 Latest commit 17cd197
🔍 Latest deploy log https://app.netlify.com/projects/v12-carbon-react/deploys/6a8fc32964e981000948c269
😎 Deploy Preview https://deploy-preview-23108--v12-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@netlify

netlify Bot commented Aug 25, 2026

Copy link
Copy Markdown

Deploy Preview for v12-carbon-web-components ready!

Name Link
🔨 Latest commit 17cd197
🔍 Latest deploy log https://app.netlify.com/projects/v12-carbon-web-components/deploys/6a8fc3293d424a0008d7c86c
😎 Deploy Preview https://deploy-preview-23108--v12-carbon-web-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the DCO.
Posted by the DCO Assistant Lite bot.

@netlify

netlify Bot commented Aug 25, 2026

Copy link
Copy Markdown

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit b57d700
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-react/deploys/6a8d5b68823ba30008662a0d
😎 Deploy Preview https://deploy-preview-23108--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@netlify

netlify Bot commented Aug 25, 2026

Copy link
Copy Markdown

Deploy Preview for v11-carbon-web-components ready!

Name Link
🔨 Latest commit b57d700
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-web-components/deploys/6a8d5b68823ba30008662a12
😎 Deploy Preview https://deploy-preview-23108--v11-carbon-web-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@netlify

netlify Bot commented Aug 25, 2026

Copy link
Copy Markdown

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit b57d700
🔍 Latest deploy log https://app.netlify.com/projects/carbon-elements/deploys/6a8d5b68a4c4280008bf0138
😎 Deploy Preview https://deploy-preview-23108--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@netlify

netlify Bot commented Aug 25, 2026

Copy link
Copy Markdown

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 749774c
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-react/deploys/6a8d5bd15f86ba00084b36ad
😎 Deploy Preview https://deploy-preview-23108--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@netlify

netlify Bot commented Aug 25, 2026

Copy link
Copy Markdown

Deploy Preview for v11-carbon-web-components ready!

Name Link
🔨 Latest commit 749774c
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-web-components/deploys/6a8d5bd1e9017900071d4e84
😎 Deploy Preview https://deploy-preview-23108--v11-carbon-web-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@netlify

netlify Bot commented Aug 25, 2026

Copy link
Copy Markdown

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 1959c69
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-react/deploys/6a8d5c31904fc40008203d0c
😎 Deploy Preview https://deploy-preview-23108--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@netlify

netlify Bot commented Aug 25, 2026

Copy link
Copy Markdown

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 749774c
🔍 Latest deploy log https://app.netlify.com/projects/carbon-elements/deploys/6a8d5bd126627700089dc378
😎 Deploy Preview https://deploy-preview-23108--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@netlify

netlify Bot commented Aug 25, 2026

Copy link
Copy Markdown

Deploy Preview for v11-carbon-web-components ready!

Name Link
🔨 Latest commit 1959c69
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-web-components/deploys/6a8d5c31d2b8e70008a76243
😎 Deploy Preview https://deploy-preview-23108--v11-carbon-web-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@netlify

netlify Bot commented Aug 25, 2026

Copy link
Copy Markdown

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit c354222
🔍 Latest deploy log https://app.netlify.com/projects/carbon-elements/deploys/6a8d5d01da4920000703d7dc
😎 Deploy Preview https://deploy-preview-23108--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@netlify

netlify Bot commented Aug 25, 2026

Copy link
Copy Markdown

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 17cd197
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-react/deploys/6a8fc32964438c0008a81d07
😎 Deploy Preview https://deploy-preview-23108--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@netlify

netlify Bot commented Aug 25, 2026

Copy link
Copy Markdown

Deploy Preview for v11-carbon-web-components ready!

Name Link
🔨 Latest commit 17cd197
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-web-components/deploys/6a8fc329c229aa00090a394a
😎 Deploy Preview https://deploy-preview-23108--v11-carbon-web-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@netlify

netlify Bot commented Aug 25, 2026

Copy link
Copy Markdown

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 17cd197
🔍 Latest deploy log https://app.netlify.com/projects/carbon-elements/deploys/6a8fc32945b3b8000820b21e
😎 Deploy Preview https://deploy-preview-23108--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

Signed-off-by: Arslan Sohail <arslansohail.2001@gmail.com>
@arslansohail2001

Copy link
Copy Markdown
Author

I have read the DCO document and I hereby sign the DCO.

@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.65%. Comparing base (bd0b4c8) to head (17cd197).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #23108      +/-   ##
==========================================
- Coverage   89.67%   89.65%   -0.02%     
==========================================
  Files         639      639              
  Lines       58865    58865              
  Branches     8267     8267              
==========================================
- Hits        52786    52778       -8     
- Misses       5913     5921       +8     
  Partials      166      166              
Flag Coverage Δ
main-packages 87.15% <100.00%> (ø)
web-components 90.52% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@adamalston adamalston left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The issue linked in #23108 (comment) doesn't appear to exist.

https://github.com/carbon-design-system/carbon/issues/22831:

This issue has been deleted.

Comment thread packages/react/src/components/Menu/MenuItem.tsx Outdated
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.

2 participants