Skip to content

fix(menu-item): bugs with disabled state#21340

Merged
heloiselui merged 5 commits into
carbon-design-system:mainfrom
olihf-dematic:menu-item-fix
Apr 29, 2026
Merged

fix(menu-item): bugs with disabled state#21340
heloiselui merged 5 commits into
carbon-design-system:mainfrom
olihf-dematic:menu-item-fix

Conversation

@olihf-dematic

Copy link
Copy Markdown
Contributor

Closes #21337

Fixes styling on disabled menu-item.
Fixes menu closing when clicking disabled menu-item

Changelog

New

  • N/A

Changed

  • Changed how pointer: not allowed is applied to disabled menu-items
  • Updated click handling of menu-item to not dispatch event if clicked item is disabled
  • Updated menu-button to ensure it uses the correct event handler for menu-items, preventing it from closing when clicking any menu-item

Removed

  • N/A

Testing / Reviewing

  • Take the storybook example for menu-button
  • Verify the disabled entry shows the not allowed cursor, no matter where you hover over the menu-item
  • Click the disabled entry, verify the menu does not close

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
    - [ ] 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

More details can be found in the pull request guide

@olihf-dematic olihf-dematic requested a review from a team as a code owner January 21, 2026 12:58
@netlify

netlify Bot commented Jan 21, 2026

Copy link
Copy Markdown

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 5a009d3
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-react/deploys/6970cd7c76721a0008c5ff1a
😎 Deploy Preview https://deploy-preview-21340--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 project configuration.

@netlify

netlify Bot commented Jan 21, 2026

Copy link
Copy Markdown

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

Name Link
🔨 Latest commit 5a009d3
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-web-components/deploys/6970cd7c872e91000884ebed
😎 Deploy Preview https://deploy-preview-21340--v11-carbon-web-components.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 project configuration.

@netlify

netlify Bot commented Jan 21, 2026

Copy link
Copy Markdown

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 5a009d3
🔍 Latest deploy log https://app.netlify.com/projects/carbon-elements/deploys/6970cd7ca0a0260008e9eb2c
😎 Deploy Preview https://deploy-preview-21340--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 project configuration.

@netlify

netlify Bot commented Jan 21, 2026

Copy link
Copy Markdown

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 467b821
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-react/deploys/69f1cb4f4d87ac00086f1969
😎 Deploy Preview https://deploy-preview-21340--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 project configuration.

@netlify

netlify Bot commented Jan 21, 2026

Copy link
Copy Markdown

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

Name Link
🔨 Latest commit 467b821
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-web-components/deploys/69f1cb4f69cd61000831b513
😎 Deploy Preview https://deploy-preview-21340--v11-carbon-web-components.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 project configuration.

@netlify

netlify Bot commented Jan 21, 2026

Copy link
Copy Markdown

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 415612a
🔍 Latest deploy log https://app.netlify.com/projects/carbon-elements/deploys/6971f362db23e90008a820f0
😎 Deploy Preview https://deploy-preview-21340--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 project configuration.

@codecov

codecov Bot commented Jan 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.07%. Comparing base (585f191) to head (467b821).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
packages/react/src/components/Menu/MenuItem.tsx 66.66% 1 Missing ⚠️
...es/web-components/src/components/menu/menu-item.ts 90.90% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #21340      +/-   ##
==========================================
- Coverage   95.10%   95.07%   -0.03%     
==========================================
  Files         541      541              
  Lines       45179    45192      +13     
  Branches     6537     6482      -55     
==========================================
- Hits        42966    42965       -1     
- Misses       2084     2098      +14     
  Partials      129      129              
Flag Coverage Δ
main-packages 89.15% <66.66%> (-0.01%) ⬇️
web-components 97.87% <91.66%> (-0.02%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 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.

@emyarod emyarod left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks good, clicking the disabled menu item no longer closes the menu
just want to confirm with @carbon-design-system/design about the focus outline still being applied to the disabled item

@emyarod emyarod requested review from a team and Rory-McDonald and removed request for a team February 4, 2026 21:57

@Kritvi-bhatia17 Kritvi-bhatia17 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks good, clicking the disabled menu item no longer closes the menu just want to confirm with @carbon-design-system/design about the focus outline still being applied to the disabled item

Hi @olihf-dematic, great work! However the focus shouldn't be on the disabled state.

@Rory-McDonald

Copy link
Copy Markdown

@emyarod FYI I also noticed the issue about the focus border showing on the disabled state is also happening in the react storybook.

@emyarod

emyarod commented Feb 12, 2026

Copy link
Copy Markdown
Member

@Rory-McDonald thanks for the info! I think we can open a separate ticket for that then

@Kritvi-bhatia17 would this PR be ok to merge if the disabled state focus outline is resolved separately?

@Kritvi-bhatia17

Copy link
Copy Markdown
Member

@Rory-McDonald thanks for the info! I think we can open a separate ticket for that then

@Kritvi-bhatia17 would this PR be ok to merge if the disabled state focus outline is resolved separately?

@emyarod It would be ideal to address the disabled‑state focus outline issue within this PR since it affects a11y. However, if the fix is broader in scope and will require more time, feel free to make the call.

@olihf-dematic

Copy link
Copy Markdown
Contributor Author

I don't mind either approach, I noticed when working on it that it was a bit odd to still have the focus. However as it was the same as react I didn't touch it. If it should be done in the same ticket, just let me know and I'll crack on!

@olihf-dematic

Copy link
Copy Markdown
Contributor Author

Hi @emyarod I've updated this MR to solve the focus issue on React and WC

@olihf-dematic

Copy link
Copy Markdown
Contributor Author

@Kritvi-bhatia17 Just highlighting the above

@Kritvi-bhatia17 Kritvi-bhatia17 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you so much for working on this @olihf-dematic! LGTM visually 🚀

@emyarod emyarod left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks good to me!

@tay1orjones tay1orjones added this pull request to the merge queue Apr 28, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 28, 2026
@heloiselui heloiselui added this pull request to the merge queue Apr 29, 2026
Merged via the queue into carbon-design-system:main with commit bf130cb Apr 29, 2026
39 checks passed
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.

[Bug]: WC Menu-Item, disabled state usability issues

6 participants