Skip to content

fix Overlay: Change default overflow from hidden to auto#7571

Merged
liuliu-dev merged 3 commits intomainfrom
liuliu/anchoredoverlay-overflow-fix
Feb 23, 2026
Merged

fix Overlay: Change default overflow from hidden to auto#7571
liuliu-dev merged 3 commits intomainfrom
liuliu/anchoredoverlay-overflow-fix

Conversation

@liuliu-dev
Copy link
Copy Markdown
Contributor

@liuliu-dev liuliu-dev commented Feb 19, 2026

Related issue https://github.com/github/accessibility-audits/issues/14861

Changelog

The Overlay component sets max-height: 100vh with overflow: hidden by default. At small viewports (e.g. 320×256px), this causes overlay content to be clipped. This change updates the default overflow from hidden to auto

Before:

Screen.Recording.2026-02-20.at.11.39.46.AM.mov

After:

Screen.Recording.2026-02-20.at.11.40.50.AM.mov

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

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 19, 2026

🦋 Changeset detected

Latest commit: 9a0a92e

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

This PR includes changesets to release 1 package
Name Type
@primer/react 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 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 Feb 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor

👋 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. Or, apply the integration-tests: skipped manually label to skip these checks.

@primer-integration
Copy link
Copy Markdown

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

@primer-integration
Copy link
Copy Markdown

Integration test results from github/github-ui:

Passed  CI   Passed
Passed  VRT   Passed
Running  Projects   Running

@liuliu-dev liuliu-dev marked this pull request as ready for review February 20, 2026 19:34
@liuliu-dev liuliu-dev requested a review from a team as a code owner February 20, 2026 19:34
@liuliu-dev liuliu-dev requested review from Copilot and siddharthkp and removed request for Copilot February 20, 2026 19:34
Copy link
Copy Markdown
Member

@siddharthkp siddharthkp left a comment

Choose a reason for hiding this comment

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

Seems intuitive to me, but..

git blame led me to this PR from 5 years ago when this was added, something worth testing if we are bringing back the visual bugs this had solved: #1248

Commenting for now, will wait for your response before approving

@liuliu-dev
Copy link
Copy Markdown
Contributor Author

Seems intuitive to me, but..

git blame led me to this PR from 5 years ago when this was added, something worth testing if we are bringing back the visual bugs this had solved: #1248

Commenting for now, will wait for your response before approving

@siddharthkp Thanks for the heads up!

I don't think this fix will bring back the bug.

The key difference between what #1248 reverted and this fix is overflow: visible vs overflow: auto. Whenoverflow: hidden was removed (reverting to overflow: visible), which does not create a clipping context, that's what caused content to past the border-radius corners.

Both hidden and auto create a clipping context, so the border-radius corner issue does not come back.

I tested with the ActionMenu MultipleSections story. When resizing the viewport to a smaller height, the menu list gets cut off. I recorded the difference between overflow: auto, overflow: hidden, and removing overflow.

Screen.Recording.2026-02-20.at.2.54.42.PM.mov

@siddharthkp
Copy link
Copy Markdown
Member

Valid, can we check how Overlays with controls behave? For example: ConfirmationDialog, SelectPanel with footer

@liuliu-dev
Copy link
Copy Markdown
Contributor Author

@siddharthkp I checked both:

ConfirmationDialog doesn't use the Overlay component. It renders via Dialog, which has its own Portal and CSS with ScrollableRegion handling overflow.

SelectPanel does use Overlay via AnchoredOverlay, the ActionList inside the panel scrolls. I tested the MultiSelectModal story at small viewports and they work correctly with overflow: auto:

MultiSelectModal.mov

Copy link
Copy Markdown
Member

@siddharthkp siddharthkp left a comment

Choose a reason for hiding this comment

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

Amazing, thanks for double checking!

@liuliu-dev liuliu-dev added this pull request to the merge queue Feb 23, 2026
Merged via the queue into main with commit 59ab235 Feb 23, 2026
53 checks passed
@liuliu-dev liuliu-dev deleted the liuliu/anchoredoverlay-overflow-fix branch February 23, 2026 20:13
@primer primer bot mentioned this pull request Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

2 participants