fix: make scrollable modal a separate prop rather than the default#2314
Open
fix: make scrollable modal a separate prop rather than the default#2314
Conversation
Bracciata
commented
Apr 8, 2026
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses the breaking change from #2125 by making “scrollable modal” behavior opt-in via a variant="scrollable" rather than the default.
Changes:
- Scopes scrollable dialog sizing/overflow behavior to a new
.Modal--scrollablevariant class. - Extends the React
ModalAPI to supportvariant="scrollable"and updates relevant tests/screenshots accordingly. - Documents the new scrollable modal variant and updates the prop docs.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/styles/dialog.css | Scopes scrollable max-height/overflow rules to .Modal--scrollable and adjusts dialog CSS variables. |
| packages/react/src/components/Modal/index.tsx | Adds scrollable to the variant union and applies Modal--scrollable class when selected. |
| packages/react/src/components/Modal/index.test.tsx | Adds coverage for the new Modal--scrollable class and updates long-content a11y test to use the scrollable variant. |
| packages/react/src/components/Modal/screenshots.e2e.tsx | Updates large-content screenshot fixtures to use variant="scrollable". |
| docs/pages/components/Modal.mdx | Adds documentation + example for the scrollable variant and updates the variant prop description/type list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…dron into fix/modal-changes
shawnsharpDQ
previously approved these changes
Apr 8, 2026
gupta-tanvi26
previously approved these changes
Apr 9, 2026
30369ab
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.
This addresses a breaking change introduced in #2125.
Changes
scrollableboolean propmax-height/overflow-y: autoCSS rules to.Modal--scrollableonlyscrollableprop is separate fromvariant, allowing composition withvariant="info"6.25remto4remfor better use of available viewport spacez-indexto25so modals render above the headerscrollableclass and accessibilityMigration
If you were relying on the scrollable-by-default behavior introduced in #2125, add the
scrollableprop to your Modal:The
scrollableprop can also be combined withvariant="info":