Repository navigation
Select: do not lock document scroll when the options open - #128
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
jules-exel
approved these changes
Sep 23, 2026
Headless UI 2.1 makes ComboboxOptions modal by default, which applies its
scroll lock to <html> (overflow: hidden plus a padding-right equal to the
scrollbar width). Opening a Select shifted the consumer app sideways and left
a blank bar where the scrollbar was. A dropdown should not lock page scroll,
so pass modal={false} on Select's options panel and on the older ComboBox's
options panel, which had the same default.
Align the Headless UI peer ranges with the 2.1 API the code depends on. The
resolved version in yarn.lock stays at 2.1.10; only the range key changed.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
DerekAgility
force-pushed
the
dlo/select-no-scroll-lock
branch
from
September 23, 2026 16:52
0ff5281 to
c7afbbd
Compare
jules-exel
approved these changes
Sep 23, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Opening a
Selectlocked document scroll. The whole consumer app shifted left by the scrollbar width and a white bar appeared where the scrollbar had been. Reproduced in the Manager App on the Pages screen with the Build Pages From select in the page properties side panel.Root cause
SelectrendersComboboxOptionswithanchor="bottom start". In Headless UI 2.1ComboboxOptionsismodalby default, and a modal panel applies Headless UI's document scroll lock:overflow: hiddenon<html>plus apadding-rightequal to the scrollbar width (hooks/document-overflow/adjust-scrollbar-padding.js). A dropdown should not lock page scroll.While checking the other option panels I found the
modaldefault is not tied toanchorin 2.1.10. The older, unanchoredComboBoxcomponent locks scroll the same way, confirmed with a throwaway jsdom test.Changes
stories/molecules/inputs/select/Select.tsx:modal={false}onComboboxOptions.stories/molecules/inputs/combobox/ComboBox.tsx:modal={false}onCombobox.Options, same default, same dropdown semantics.stories/molecules/inputs/select/tests/Select.test.tsx: new test opens the select and assertsdocument.documentElementhas no inlineoverfloworpadding-right. It fails onmainwithoverflow: hiddenand passes with the fix.package.json: Headless UI peer ranges were still^1.7.10/^0.1.2while the code depends on the 2.1 API and themodalprop, which does not exist in v1. Peers are now^2.1.0/^0.2.1, and the dependency range is^2.1.0to match.yarn.lock: only the@headlessui/reactrange key changed. The resolved version stays2.1.10with the same integrity hash. A plainyarn installagainst the new range would have upgraded to 2.2.10 and pulled in react-aria; I deliberately did not take that upgrade here.Reviewed and left alone
DropdownWithMultiSelectuses an anchoredPopoverPanel.PopoverPaneldefaultsmodaltofalse, so it never locked scroll.DropdownComponentuses Floating UI, not Headless UI. Itsmodal={true}is onFloatingFocusManagerand controls focus trapping, not scroll.ListboxOptionsorMenuItemsusages in the repo.Consumer note
Tightening the peer range means consumers on Headless UI 1.x get an install-time peer warning (yarn 1) or error (npm 7+) instead of the runtime breakage they already had with the current
Select. Worth confirming the Manager App is on 2.x before release.Not in this PR
No version bump or
CHANGELOG.mdentry. Release is handled separately.Verification
yarn vitest run: 63 passed (62 existing + 1 new)yarn lint: cleantsc --noEmit: cleanyarn install --frozen-lockfile: passes🤖 Generated with Claude Code