fix(admin-signup): fix Continue button cutoff on desktop viewports (fixes #1411)#7028
fix(admin-signup): fix Continue button cutoff on desktop viewports (fixes #1411)#7028codewithsupra wants to merge 1 commit into
Conversation
…tify-center with my-auto Using `justify-center` on a flex container with `overflow-y-auto` and `max-h-screen` causes content that overflows the viewport to be clipped above the scroll origin — making it unreachable by scrolling. This is a known CSS/browser behaviour where the overflow is symmetrically distributed and the portion above the visible area cannot be scrolled to. Fixes the signup button being cut off on desktop by: - Removing `justify-center` and `max-h-screen` from the outer wrapper - Adding `my-auto py-8` to the inner content wrapper With `my-auto`, the content is centred vertically when the viewport has spare space, but when the form is taller than the viewport the margin collapses to 0 and `overflow-y-auto` allows the user to scroll down to the button. Fixes Infisical#1411
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 70084c2bca
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
|
||
| return ( | ||
| <div className="flex max-h-screen min-h-screen flex-col justify-center overflow-y-auto bg-linear-to-tr from-mineshaft-600 via-mineshaft-800 to-bunker-700 px-6"> | ||
| <div className="flex min-h-screen flex-col overflow-y-auto bg-linear-to-tr from-mineshaft-600 via-mineshaft-800 to-bunker-700 px-6"> |
There was a problem hiding this comment.
Restore a bounded scroll container
When the signup form is taller than the viewport (for example a short desktop window or browser zoom), this div no longer has a definite/max height, so overflow-y-auto does not create an internal scrollport. Since frontend/src/index.css sets html to overflow-hidden, the viewport/body cannot scroll either, leaving the lower part of the admin signup form unreachable in the same scenario this change is meant to fix. Keeping a viewport-bound height here (while avoiding justify-center) is needed for the page to scroll.
Useful? React with 👍 / 👎.
|
| Filename | Overview |
|---|---|
| frontend/src/pages/admin/SignUpPage/SignUpPage.tsx | Removes max-h-screen and justify-center from the outer scroll container, adds my-auto py-8 to the inner wrapper — correctly fixing the known flexbox overflow-centering bug that made the Continue button unreachable on tall viewports. |
Reviews (1): Last reviewed commit: "fix(admin-signup): fix button cutoff on ..." | Re-trigger Greptile
Problem
The admin signup form's Continue button is cut off and unreachable on desktop screens because the page uses
justify-centeron a flex container that also hasmax-h-screen+overflow-y-auto.This is a well-known CSS behaviour: when
justify-content: centeris applied to a flex/grid container withoverflow: auto, the overflow is distributed equally above and below the content. The portion clipped above the scroll origin cannot be scrolled to — the browser won't scroll past position 0. The user can see half the form is missing but cannot reach the button by scrolling.Reference: https://stackoverflow.com/questions/33454533/cant-scroll-to-top-of-flex-item-that-is-overflowing-container
Fix
Why this works:
my-autoon a flex child centres the content vertically when the parent has spare height (normal desktop)my-autocollapses to0andoverflow-y-autoallows the user to scroll down to the Continue buttonmax-h-screenfrom the outer div lets the container grow naturally;min-h-screenstill ensures the gradient covers the full viewportBefore / After
Fixes #1411