Skip to content

fix(popover): outsideClick should not fire on already-hidden popovers#3101

Merged
bennypowers merged 3 commits intomainfrom
fix/popover-outside-click
Apr 15, 2026
Merged

fix(popover): outsideClick should not fire on already-hidden popovers#3101
bennypowers merged 3 commits intomainfrom
fix/popover-outside-click

Conversation

@bennypowers
Copy link
Copy Markdown
Member

Summary

Guard the #outsideClick handler to skip popovers that are already
hidden. Previously, clicking anywhere on the page would dispatch
hide and hidden events on ALL popover instances, even closed ones.

Closes #2513

Test plan

  • Open popover A, click outside, verify it closes
  • With popovers A and B, open A, click outside, verify only A fires hide events
  • Verify no hide events fire on closed popovers when clicking the page

Guard the outsideClick handler to skip popovers that are already
hidden, preventing spurious hide/hidden events on closed popovers
when clicking anywhere on the page.

Closes #2513

Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 15, 2026

🦋 Changeset detected

Latest commit: a768828

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@patternfly/elements Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 15, 2026

✅ Commitlint tests passed!

More Info
{
  "valid": true,
  "errors": [],
  "warnings": [],
  "input": "fix(popover): outsideClick should not fire on already-hidden popovers"
}

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 15, 2026

Deploy Preview for patternfly-elements ready!

Name Link
🔨 Latest commit 26068b0
😎 Deploy Preview https://deploy-preview-3101--patternfly-elements.netlify.app/

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

@github-actions github-actions bot added the AT passed Automated testing has passed label Apr 15, 2026
@github-actions
Copy link
Copy Markdown
Contributor

SSR Test Run for fac0394: Report

@github-actions

This comment has been minimized.

@bennypowers bennypowers enabled auto-merge (squash) April 15, 2026 13:13
@zeroedin zeroedin self-requested a review April 15, 2026 15:06
@bennypowers bennypowers merged commit a060b8b into main Apr 15, 2026
14 checks passed
@bennypowers bennypowers deleted the fix/popover-outside-click branch April 15, 2026 15:12
@github-actions
Copy link
Copy Markdown
Contributor

SSR Test Run for 26068b0: Report

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

Labels

AT passed Automated testing has passed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] pf-popover outsideClick event trigger for all popovers present on the page.

2 participants