Skip to content

Conversation

@francinelucca
Copy link
Member

Closes https://github.com/github/primer/issues/2593

Changelog

New

  • Add onClickOutside, ignoreClickRefs to Popover.Content to allow closing the Popover on click outside

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

@francinelucca francinelucca requested a review from a team as a code owner October 23, 2025 14:32
@changeset-bot
Copy link

changeset-bot bot commented Oct 23, 2025

🦋 Changeset detected

Latest commit: 6aa3071

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

This PR includes changesets to release 2 packages
Name Type
@primer/react Minor
@primer/styled-react Major

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.
@github-actions github-actions bot added the staff Author is a staff member label Oct 23, 2025
@github-actions
Copy link
Contributor

👋 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!

@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Oct 23, 2025
Copy link
Contributor

Copilot AI left a 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 onClickOutside callback and ignoreClickRefs props to Popover.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

Copy link
Contributor

Copilot AI commented Oct 23, 2025

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

@github-actions github-actions bot requested a deployment to storybook-preview-7063 October 23, 2025 14:37 Abandoned
@github-actions github-actions bot requested a deployment to storybook-preview-7063 October 23, 2025 14:43 Abandoned
@github-actions github-actions bot temporarily deployed to storybook-preview-7063 October 23, 2025 14:52 Inactive
… re-renders (#7064)

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: francinelucca <[email protected]>
@francinelucca francinelucca added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Oct 23, 2025
@github-actions github-actions bot temporarily deployed to storybook-preview-7063 October 23, 2025 17:58 Inactive
@francinelucca francinelucca removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Oct 23, 2025
@github-actions github-actions bot requested a deployment to storybook-preview-7063 October 23, 2025 20:53 Abandoned
@francinelucca francinelucca removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Oct 24, 2025
@github-actions github-actions bot temporarily deployed to storybook-preview-7063 October 24, 2025 13:52 Inactive
@francinelucca francinelucca added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Oct 24, 2025
@primer primer bot requested a review from a team as a code owner October 24, 2025 14:34
@primer primer bot requested a review from mperrotti October 24, 2025 14:34
@github-actions github-actions bot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Oct 24, 2025
@github-actions github-actions bot temporarily deployed to storybook-preview-7063 October 24, 2025 14:44 Inactive
@primer-integration
Copy link

👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/5837

@github-actions github-actions bot added integration-tests: failing Changes in this PR cause breaking changes in gh/gh and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Oct 29, 2025
@primer-integration
Copy link

🟢 ci completed with status success.

@github-actions github-actions bot added integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh and removed integration-tests: failing Changes in this PR cause breaking changes in gh/gh labels Oct 29, 2025
@francinelucca francinelucca added this pull request to the merge queue Oct 29, 2025
Merged via the queue into main with commit 247c66a Oct 29, 2025
43 checks passed
@francinelucca francinelucca deleted the feat/popover-implement-click-outside branch October 29, 2025 01:29
@primer primer bot mentioned this pull request Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh staff Author is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants