Skip to content

fix(OverflowMenu): forwardsRef #19035

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

Conversation

AlexanderMelox
Copy link
Contributor

@AlexanderMelox AlexanderMelox commented Apr 4, 2025

Fixes test issue over in ibm-products carbon-design-system/ibm-products#7199

Currently updating to the latest version of carbon v11.79.0 fails our forwardRef tests

Screenshot 2025-04-04 at 12 31 10 PM

Currently our ButtonMenu component utilizes OverflowMenu under the hood

Changelog

Changed

  • Added forwardRef to OverflowMenu

Copy link

netlify bot commented Apr 4, 2025

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

Name Link
🔨 Latest commit e0e458c
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-web-components/deploys/67f7e43f5f05100008c950a5
😎 Deploy Preview https://deploy-preview-19035--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 site configuration.

Copy link

netlify bot commented Apr 7, 2025

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 6170b03
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/67f4011b7229500008fe391b
😎 Deploy Preview https://deploy-preview-19035--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

netlify bot commented Apr 7, 2025

Deploy Preview for v11-carbon-react ready!

Name Link
🔨 Latest commit e0e458c
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/67f7e43fe25ea7000812ceb9
😎 Deploy Preview https://deploy-preview-19035--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
Member

@tay1orjones tay1orjones left a comment

Choose a reason for hiding this comment

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

Curious, were you relying on innerRef before?


Would you mind adding a couple tests to ensure each usage works as expected? Something lightweight like this maybe?

it('should accept a `ref` for the outermost element', () => {
const ref = jest.fn();
const { container } = render(<Breadcrumb ref={ref} />);
expect(ref).toHaveBeenCalledWith(container.firstChild);
});

@AlexanderMelox
Copy link
Contributor Author

@tay1orjones haha yes I was just on that

@AlexanderMelox
Copy link
Contributor Author

Pushing the test while we talk 👍🏻

@tay1orjones
Copy link
Member

@AlexanderMelox Hey I don't think this will fix #19046 since innerRef is still not used and will remain broken. If you want to fix it here that's cool but for now I'll pull the Fixes line out of the PR body

Copy link

codecov bot commented Apr 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.96%. Comparing base (26b2544) to head (e0e458c).
Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #19035   +/-   ##
=======================================
  Coverage   84.96%   84.96%           
=======================================
  Files         391      391           
  Lines       14490    14491    +1     
  Branches     4773     4721   -52     
=======================================
+ Hits        12312    12313    +1     
- Misses       2029     2030    +1     
+ Partials      149      148    -1     

☔ 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.

@kennylam kennylam added this pull request to the merge queue Apr 10, 2025
Merged via the queue into carbon-design-system:main with commit 65f005a Apr 10, 2025
37 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.

5 participants