Skip to content

Fix dialog content overflow on small viewports#42473

Open
mdo wants to merge 1 commit into
v6-devfrom
mdo/issue-42459-min-height-fit
Open

Fix dialog content overflow on small viewports#42473
mdo wants to merge 1 commit into
v6-devfrom
mdo/issue-42459-min-height-fit

Conversation

@mdo
Copy link
Copy Markdown
Member

@mdo mdo commented Jun 6, 2026

Closes #42459.

Default .dialog used overflow: visible, so when content was taller than the viewport the body/footer rendered off-screen and unreachable. Switched the default dialog to overflow: auto so the whole dialog scrolls within its max-height (matching v5's default modal), and set .dialog-scrollable to overflow: hidden so only its body scrolls with the header/footer pinned.

@mdo mdo requested a review from a team as a code owner June 6, 2026 03:03
@coliff
Copy link
Copy Markdown
Contributor

coliff commented Jun 6, 2026

Test: https://deploy-preview-42473--twbs-bootstrap.netlify.app/docs/6.0/components/dialog

Tested on Safari 26.5, Edge 148 and Firefox 151 with no issues. The scrollbar does appear on the dialog itself though, with Bootstrap v5 the scrollbar was on the main body which was preferable I think. I haven't looked into if that is possible though.

Firefox 151 (macOS) with this fix:
image

Firefox 151 (macOS) with Bootstrap 5
image

@ajiho
Copy link
Copy Markdown

ajiho commented Jun 7, 2026

I checked the test link above. It would be great if it could stay consistent with Bootstrap 5. I’m not sure whether this can be achieved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Inbox

Development

Successfully merging this pull request may close these issues.

The content overflows when the dialog is resized to a smaller screen.

4 participants