Skip to content

Conversation

@maradwan26
Copy link
Contributor

@maradwan26 maradwan26 commented Dec 5, 2025

Closes #21063
Closes #21110

Fixes two issues with popover:

  • Clicking popover-content on a popover used inside shadow-root with slotted elements closes the popover
  • Unable to open popover when wrapped in another component

I decided to fix both issues in the same PR as they both originate from the same function. Note that an issue very similar to the second one was fixed #20747, I decided to keep the test story from that PR to ensure there aren't any regressions.

Changelog

New

  • Added conditions in _handleOutsideClick that prevent the popover from closing if the click was on the trigger button or the popoverContent
  • Added the following test stories:
    • Test 1 Should Open and Close
      • This is the same test story from #20747
      • Clicking on the button labelled "PRESS ME" should open and close the popover
    • Test 2 Should Not Close On Content Click
      • This is an exact replica of the reproduction from #21063
      • Clicking the popoverContent "...50 GB of block storage remaining" should not close the popover
    • Test 3 Should Open and Close
      • This is an exact replica of the reproduction from #21110
      • Clicking on the trigger button should open and close the popover

Note

All test stories, and their related imports and classes should be removed before merging

Testing / Reviewing

  • Check all Test stories, all behaviours should work as expected
  • There shouldn't be any regressions in the other stories

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

@maradwan26 maradwan26 requested a review from a team as a code owner December 5, 2025 19:50
@netlify
Copy link

netlify bot commented Dec 5, 2025

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 2ec1f6a
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-react/deploys/6933378c4f8d8500098ca55e
😎 Deploy Preview https://deploy-preview-21137--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
Copy link

netlify bot commented Dec 5, 2025

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 2ec1f6a
🔍 Latest deploy log https://app.netlify.com/projects/carbon-elements/deploys/6933378cac85ca000821b4b8
😎 Deploy Preview https://deploy-preview-21137--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
Copy link

netlify bot commented Dec 5, 2025

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit ff7b658
🔍 Latest deploy log https://app.netlify.com/projects/carbon-elements/deploys/69337a27b1977400084535c4
😎 Deploy Preview https://deploy-preview-21137--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
Copy link

netlify bot commented Dec 5, 2025

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit ff7b658
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-react/deploys/69337a27e00e750008de222e
😎 Deploy Preview https://deploy-preview-21137--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.

@maradwan26 maradwan26 marked this pull request as draft December 5, 2025 21:43
@maradwan26 maradwan26 marked this pull request as ready for review December 5, 2025 21:44
@maradwan26 maradwan26 marked this pull request as draft December 5, 2025 23:00
@maradwan26
Copy link
Contributor Author

maradwan26 commented Dec 5, 2025

CI seems to be running forever for some reason, converting to draft for now.

@maradwan26 maradwan26 marked this pull request as ready for review December 6, 2025 00:34
@netlify
Copy link

netlify bot commented Dec 6, 2025

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

Name Link
🔨 Latest commit ff7b658
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-web-components/deploys/69337a27a2cec00008bb8a84
😎 Deploy Preview https://deploy-preview-21137--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.

@codecov
Copy link

codecov bot commented Dec 6, 2025

Codecov Report

❌ Patch coverage is 69.23077% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.60%. Comparing base (6e1243f) to head (ff7b658).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...s/web-components/src/components/popover/popover.ts 69.23% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #21137      +/-   ##
==========================================
- Coverage   92.60%   92.60%   -0.01%     
==========================================
  Files         515      515              
  Lines       38225    38238      +13     
  Branches     5871     5845      -26     
==========================================
+ Hits        35399    35409      +10     
- Misses       2676     2679       +3     
  Partials      150      150              
Flag Coverage Δ
main-packages 85.61% <ø> (ø)
web-components 96.87% <69.23%> (-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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

2 participants