-
Notifications
You must be signed in to change notification settings - Fork 649
Feat: popover implement click outside #7063
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
🦋 Changeset detectedLatest commit: 6aa3071 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
Updated the version of @primer/react from patch to minor and added a feature for popover to implement click outside.
|
👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds click-outside functionality to the Popover component, allowing popovers to be closed when users click outside the popover content. It introduces two new props (onClickOutside and ignoreClickRefs) to Popover.Content that leverage the existing useOnOutsideClick hook.
Key changes:
- Added
onClickOutsidecallback andignoreClickRefsprops toPopover.Content - Created a feature story demonstrating the click-outside behavior
- Fixed unrelated CSS issue in PageLayout where wrapper dimensions weren't matching Root
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/react/src/Popover/Popover.tsx | Implemented click-outside detection using useOnOutsideClick hook with new props |
| packages/react/src/Popover/Popover.features.stories.tsx | Added interactive story demonstrating click-outside functionality with toggle button |
| packages/react/src/Popover/Popover.docs.json | Documented the new onClickOutside and ignoreClickRefs props |
| packages/react/src/PageLayout/PageLayout.module.css | Fixed wrapper dimensions to match Root (unrelated change) |
| e2e/components/Popover.test.ts | Added e2e test entry for the new close-on-click-outside story |
|
@francinelucca I've opened a new pull request, #7064, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: Copilot <[email protected]>
…mer/react into feat/popover-implement-click-outside
… re-renders (#7064) Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: francinelucca <[email protected]>
…mer/react into feat/popover-implement-click-outside
|
👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/5837 |
|
🟢 ci completed with status |
Closes https://github.com/github/primer/issues/2593
Changelog
New
Rollout strategy
Testing & Reviewing
Merge checklist