Skip to content

Fix SelectPanel outside-top anchor sizing regression#7863

Draft
siddharthkp wants to merge 6 commits into
mainfrom
fix/selectpanel-first-open-regression
Draft

Fix SelectPanel outside-top anchor sizing regression#7863
siddharthkp wants to merge 6 commits into
mainfrom
fix/selectpanel-first-open-regression

Conversation

@siddharthkp
Copy link
Copy Markdown
Member

@siddharthkp siddharthkp commented May 21, 2026

Closes github/issues#18331

Overview

When anchorSide is 'outside-top' and pinPosition is true, the SelectPanel overlay was preserving a stale inline height even when inner content needed to grow after loading. This happened because overflow was trapped in a descendant scroll container rather than on the overlay itself.

The fix adds a hasOverflowingDescendant helper to useAnchoredPosition that detects overflow in descendants before preserving height, and clears stale inline height when content actually needs more space.

Changelog

New

  • Added AutogrowAfterLoadingWithOutsideTopAnchor story to reproduce the regression

Changed

  • useAnchoredPosition now checks descendant overflow before preserving height when pinPosition is true

Removed

None

Rollout strategy

  • Patch release

Testing & Reviewing

  1. Open the AutogrowAfterLoadingWithOutsideTopAnchor story
  2. Click the SelectPanel trigger button
  3. Wait for loading to complete (~2s)
  4. Before fix: Panel stays small with scrollbar
  5. After fix: Panel grows to fit content, no scrollbar

Merge checklist

  • Added/updated tests
  • Added/updated previews (Storybook)
  • Changes are SSR compatible
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 21, 2026

⚠️ No Changeset found

Latest commit: b29997c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@siddharthkp siddharthkp self-assigned this May 21, 2026
@siddharthkp siddharthkp force-pushed the fix/selectpanel-first-open-regression branch from bca1d78 to e35f483 Compare May 21, 2026 12:00
@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 May 21, 2026
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Action required

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Check the integration testing docs for step-by-step instructions. Or, apply the integration-tests: skipped manually label to skip these checks.

To publish a canary release for integration testing, apply the Canary Release label to this PR.

@primer
Copy link
Copy Markdown
Contributor

primer Bot commented May 21, 2026

🤖 Lint issues have been automatically fixed and committed to this PR.

@github-actions github-actions Bot requested a deployment to storybook-preview-7863 May 21, 2026 12:07 Abandoned
selected={selected}
onSelectedChange={setSelected}
onFilterChange={setFilter}
overlayProps={{anchorSide: 'outside-top'}}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Unrelated change, but good to have here. The reposition story wasn't repositioning at all because we were always opening it above. Fixed the story, it works well.

@siddharthkp siddharthkp force-pushed the fix/selectpanel-first-open-regression branch from e35f483 to 81dd1d1 Compare May 21, 2026 12:12
@siddharthkp siddharthkp force-pushed the fix/selectpanel-first-open-regression branch from 81dd1d1 to 39a83e4 Compare May 21, 2026 12:13
@github-actions github-actions Bot requested a deployment to storybook-preview-7863 May 21, 2026 12:17 Abandoned
@primer
Copy link
Copy Markdown
Contributor

primer Bot commented May 21, 2026

🤖 Lint issues have been automatically fixed and committed to this PR.

@siddharthkp siddharthkp force-pushed the fix/selectpanel-first-open-regression branch from b884d85 to cc3880a Compare May 21, 2026 12:24
@github-actions github-actions Bot requested a deployment to storybook-preview-7863 May 21, 2026 12:24 Abandoned
@primer
Copy link
Copy Markdown
Contributor

primer Bot commented May 21, 2026

🤖 Lint issues have been automatically fixed and committed to this PR.

@github-actions github-actions Bot requested a deployment to storybook-preview-7863 May 21, 2026 12:31 Abandoned
@primer
Copy link
Copy Markdown
Contributor

primer Bot commented May 21, 2026

🤖 Lint issues have been automatically fixed and committed to this PR.

@primer
Copy link
Copy Markdown
Contributor

primer Bot commented May 21, 2026

🤖 Lint issues have been automatically fixed and committed to this PR.

@siddharthkp siddharthkp added the Canary Release Apply this label when you want CI to create a canary release of the current PR label May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Canary Release Apply this label when you want CI to create a canary release of the current PR integration-tests: recommended This 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.

1 participant