fix(admin): prevent dialogs from overflowing viewport on mobile - #99
Conversation
On small screens, admin dialogs overflow horizontally — content gets clipped on the left because various max-w-*/w-* classes exceed the viewport width. Add a global max-width cap on [role="dialog"] so all dialogs stay within the viewport. Also fix ContentPickerModal which used a fixed w-2xl instead of max-w-2xl. Fixes #92
🦋 Changeset detectedLatest commit: 4c907ec The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
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 |
@emdash-cms/admin
@emdash-cms/auth
@emdash-cms/blocks
@emdash-cms/cloudflare
emdash
create-emdash
@emdash-cms/gutenberg-to-portable-text
@emdash-cms/x402
@emdash-cms/plugin-ai-moderation
@emdash-cms/plugin-atproto
@emdash-cms/plugin-audit-log
@emdash-cms/plugin-color
@emdash-cms/plugin-embeds
@emdash-cms/plugin-forms
@emdash-cms/plugin-webhook-notifier
commit: |
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
…flow Sorry — the previous fix only set max-width on [role="dialog"], but Kumo's size variants (e.g. size="lg") apply min-width: 32rem which takes precedence over max-width in CSS. On viewports < 640px, dialogs were still overflowing because min-width won the conflict. This commit: - Wraps the dialog override in a @media (max-width: 639px) query - Adds min-width: 0 !important to actually let max-width constrain - Removes size="lg" from WelcomeModal (it was requesting min-w-[32rem] on a dialog capped at sm:max-w-md — contradictory) Tested at 390px viewport: both WelcomeModal and size="lg" dialogs now fit within calc(100vw - 2rem) on mobile. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
In styles.css, I wrapped the dialog override in a Alongside, in @BenjaminPrice, can you give it another try, please? |
Adds a useEffect that triggers onLoadMore when the user navigates to the last client-side page, so content beyond the first API page is fetched automatically. Skips fetch when a search query is active to avoid spurious loads from filtered results collapsing pagination. Also shows a "+" suffix on the item count when more pages are available and stabilizes the onLoadMore callback with useCallback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Overlapping PRsThis PR modifies files that are also changed by other open PRs:
This may cause merge conflicts or duplicated work. A maintainer will coordinate. |
The media grid had min-h-[300px] which prevented the flex layout from shrinking, pushing the footer (Cancel/Insert buttons) below the viewport. Replace with min-h-0 so the grid shrinks and scrolls internally, and add overflow-hidden on the dialog to enforce the max-h constraint. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@BenjaminPrice Whoops indeed my test case didn't include that... My bad. Can you give it another try, please? |
…sh-cms#99) * fix(admin): prevent dialogs from overflowing viewport on mobile On small screens, admin dialogs overflow horizontally — content gets clipped on the left because various max-w-*/w-* classes exceed the viewport width. Add a global max-width cap on [role="dialog"] so all dialogs stay within the viewport. Also fix ContentPickerModal which used a fixed w-2xl instead of max-w-2xl. Fixes emdash-cms#92 * fix(admin): reset min-width on mobile to actually prevent dialog overflow Sorry — the previous fix only set max-width on [role="dialog"], but Kumo's size variants (e.g. size="lg") apply min-width: 32rem which takes precedence over max-width in CSS. On viewports < 640px, dialogs were still overflowing because min-width won the conflict. This commit: - Wraps the dialog override in a @media (max-width: 639px) query - Adds min-width: 0 !important to actually let max-width constrain - Removes size="lg" from WelcomeModal (it was requesting min-w-[32rem] on a dialog capped at sm:max-w-md — contradictory) Tested at 390px viewport: both WelcomeModal and size="lg" dialogs now fit within calc(100vw - 2rem) on mobile. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(admin): auto-fetch next API page when reaching last client-side page Adds a useEffect that triggers onLoadMore when the user navigates to the last client-side page, so content beyond the first API page is fetched automatically. Skips fetch when a search query is active to avoid spurious loads from filtered results collapsing pagination. Also shows a "+" suffix on the item count when more pages are available and stabilizes the onLoadMore callback with useCallback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(admin): make media picker modal scrollable on mobile The media grid had min-h-[300px] which prevented the flex layout from shrinking, pushing the footer (Cancel/Insert buttons) below the viewport. Replace with min-h-0 so the grid shrinks and scrolls internally, and add overflow-hidden on the dialog to enforce the max-h constraint. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Matt Kane <mkane@cloudflare.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>


Summary
Fixes #92
On mobile, admin dialogs overflow the viewport horizontally — content is clipped on the left side because
max-w-*andw-*classes exceed the screen width.max-width: calc(100vw - 2rem)on[role="dialog"]instyles.cssso all dialogs (current and future) stay within the viewportContentPickerModalwhich used a fixedw-2xlinstead ofmax-w-2xlTest plan
max-w-*classes are narrower than100vw - 2rem)