Skip to content

Remove overflow property from popover - #6709

Merged
pksjce merged 13 commits into
mainfrom
pk/popover-overflow-regression
Sep 11, 2025
Merged

Remove overflow property from popover#6709
pksjce merged 13 commits into
mainfrom
pk/popover-overflow-regression

Conversation

@pksjce

@pksjcepksjce commented Sep 3, 2025

Copy link
Copy Markdown
Contributor

Closes #https://github.com/github/primer/issues/5729

The original issue was a complaint that popover does not have customisable width and that they were replacing it with an AnchoredOverlay. In #6303, I fixed this and also premptively added support for height and overflow. However, overflow:hidden default property makes the caret disappear. Fixing this here by removing overflow property altogether. If a need for this property arises in the future, we can look into how to safely add it. Probably by changing the implementation of the caret visual.

Changelog

New

Changed

Removed

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

CopilotAI review requested due to automatic review settings September 3, 2025 03:29
@pksjce
pksjce requested a review from a team as a code ownerSeptember 3, 2025 03:29
@changeset-bot

changeset-botBot commented Sep 3, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0394474

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

This PR includes changesets to release 2 packages
NameType
@primer/reactMinor
@primer/styled-reactMajor

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

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 removes the overflow property from the Popover component to fix an issue where the default overflow:hidden was causing the popover's caret to disappear.

  • Removes the overflow prop from PopoverContentProps interface and its default value
  • Removes overflow-related CSS styles and data attributes from the component implementation
  • Updates Storybook stories to remove overflow controls and usage

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

FileDescription
packages/react/src/Popover/Popover.tsxRemoves overflow prop from PopoverContentProps interface and removes overflow handling in PopoverContent component
packages/react/src/Popover/Popover.stories.tsxUpdates Playground story to remove overflow prop usage and removes overflow controls from argTypes
packages/react/src/Popover/Popover.module.cssRemoves default overflow:hidden style and all overflow-related CSS rules

@github-actions

Copy link
Copy Markdown
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-actionsgithub-actionsBot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Sep 3, 2025
@github-actions

github-actionsBot commented Sep 3, 2025

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
packages/react/dist/browser.esm.js88.61 KB (-0.03% 🔽)
packages/react/dist/browser.umd.js88.67 KB (-0.07% 🔽)

@github-actions
github-actionsBot requested a deployment to storybook-preview-6709 September 3, 2025 03:33 Abandoned
@github-actions
github-actionsBottemporarily deployed to storybook-preview-6709 September 3, 2025 03:42 Inactive
@pksjcepksjce added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Sep 3, 2025
@primer
primerBot requested a review from a team as a code ownerSeptember 3, 2025 04:53
@primer
primerBot requested a review from mperrottiSeptember 3, 2025 04:53
@github-actionsgithub-actionsBot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Sep 3, 2025
@github-actions
github-actionsBottemporarily deployed to storybook-preview-6709 September 3, 2025 05:03 Inactive
@pksjcepksjce added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Sep 4, 2025
@github-actions
github-actionsBottemporarily deployed to storybook-preview-6709 September 4, 2025 04:04 Inactive
await page.keyboard.press('Tab') // focus on icon button
await page.getByText('Bold').waitFor({
state: 'visible',
})

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

This is just a fix for the flakiness I experienced.

@github-actions
github-actionsBot requested a deployment to storybook-preview-6709 September 5, 2025 14:03 Abandoned
@github-actions
github-actionsBottemporarily deployed to storybook-preview-6709 September 5, 2025 14:11 Inactive

@langermanklangermank left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@pksjce not sure if you've accounted for this but since the caret was broken, we had to suggest teams use the overflow prop to get around it: https://primer-query.githubapp.com/?query=popover+attribute%3Aoverflow

I wonder if we should just change the default prop to visible, and then remove the prop in a separate PR as a major breaking change?

@pksjce

Copy link
Copy Markdown
ContributorAuthor

I see that this affects two uages. I can have a github-ui PR ready to go when this change is released. Does that work?
IMO, making overflow:visible for all popovers could have other side-effects?
cc- @joshblack (current RC), @llastflowers (next RC)
Would you be able to accomodate this?

@pksjce

pksjce commented Sep 9, 2025

Copy link
Copy Markdown
ContributorAuthor

Fixes for release(path-to-green)- Will update in release tracking PR after merge https://github.com/github/github-ui/pull/2049/commits/9194c3449bfb80a3977e7814edcedeeedc40d05b

@github-actions
github-actionsBottemporarily deployed to storybook-preview-6709 September 9, 2025 05:17 Inactive
@pksjcepksjce added the integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh label Sep 9, 2025
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

@siddharthkpsiddharthkp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Left a couple comments to confirm if the visual changes are intentional

Approving in advance

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Caret is back, but it seems like the background color has changed? Is that intentional?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I did notice this and checked that its the same color that primitive offers. I refreshed my node modules and ran the tests on local and there's no change to the snapshots. The primitives changed the color three months back. Do you think the snapshots were just never updated since it doesn't register color change as an error?

@siddharthkpsiddharthkpSep 10, 2025

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

that's strange!

Do you think the snapshots were just never updated since it doesn't register color change as an error?

possible, don't think i haven't seen that before 🤔 maybe others have? worth asking

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Maybe @langermank knows?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This happens sometimes. When the change is really minimal it just doesn't always pick it up.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I can't see what has changed here? 😅 Do you know? (safe to ignore?)

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I think its a flaky test. I tried to make it robust. I think its safe to ignore

@pksjce
pksjce enabled auto-merge September 10, 2025 23:13
@pksjce
pksjce disabled auto-merge September 11, 2025 22:03
@pksjce
pksjce added this pull request to the merge queueSep 11, 2025
Merged via the queue into main with commit 78784b3Sep 11, 2025
43 of 44 checks passed
@pksjce
pksjce deleted the pk/popover-overflow-regression branch September 11, 2025 22:11
@primerprimerBot mentioned this pull request Sep 11, 2025
pksjce added a commit that referenced this pull request Sep 18, 2025
Co-authored-by: pksjce <417268+pksjce@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: passingChanges in this PR do NOT cause breaking changes in gh/ghintegration-tests: recommendedThis change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@pksjce@siddharthkp@langermank