fix(modal): make modal card scrollable on mobile so the close button is reachable#32
Merged
Merged
Conversation
On small viewports the How It Works content is taller than the screen. .snd-modal centers the card with align-items: center and .snd-modal-card had no height bound, so the card overflowed both the top and bottom edges — pushing the X (top) and the Close CTA (bottom) off-screen with no way to scroll, trapping the user in the dialog. Bound the card to the viewport (max-height: 100%) and let it scroll internally (overflow-y: auto, overscroll-behavior: contain). The X is now visible on open and both close controls are reachable. General fix — applies to every modal, not just How It Works. Verified on a 375x600 viewport: X visible on open, card scrolls, bottom CTA reachable after scroll, clicking X closes the dialog.
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
On mobile, the How It Works dialog trapped users — the close X couldn't be reached.
Root cause:
.snd-modalcenters its card withalign-items: center, and.snd-modal-cardhad no height bound or overflow. When the dialog content is taller than the viewport (the How It Works modal is long on phones: lede + diagram + 4 steps + footnote + CTA), the vertically-centered card overflows both edges — pushing the X (top) and the "Close" CTA (bottom) off-screen, with no way to scroll. The backdrop is only tappable in the thin 16px side margins, so there's no reliable escape.Fix: bound the card to the viewport and let it scroll internally.
This is a general modal fix — every modal was susceptible to the same trap, not just How It Works.
Test plan
Verified in headless Chrome at 375×600 (small phone):
top:31, bottom:75, inside the 600px viewport)bottom:559)npm run lint:css— 0 errors