Skip to content

Commit bfd3c90

Browse files
Keep modal OK button in view when message content overflows
The save-failure dialog now renders multi-section help text (headers, list, link, several paragraphs), which exceeds the existing max-height: 365px on .popup-modal.prompt. The message div was overflowing past the modal box and pushing the OK button below the visible area. Restructure .popup-modal.prompt as a flex column: - max-height: 80vh (more room when needed, still capped) - Content area (#message) gets flex: 1 1 auto + overflow-y: auto, so long content scrolls inside the box. - Buttons get flex: 0 0 auto, so they stay pinned at the bottom of the modal regardless of content size. - The display: flex on .popup-modal.prompt.is--visible has three-class specificity, beating the existing .popup-modal.is--visible display: block rule without an !important. Separately, cap the message dialog at max-width min(480px, 90vw) via attribute selector so multi-paragraph prose wraps at a comfortable reading measure (~60-65ch) rather than stretching across the full viewport on wide monitors. Other prompt dialogs (unsaved, upload-type, connection-type, ok-cancel) are short and unaffected.
1 parent 4bed4df commit bfd3c90

1 file changed

Lines changed: 26 additions & 1 deletion

File tree

sass/layout/_layout.scss

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,32 @@
318318
display: none;
319319

320320
&.prompt {
321-
max-height: 365px;
321+
max-height: 80vh;
322+
// Flex column so the buttons stay pinned to the bottom and the
323+
// content area can scroll when a dialog has rich/multi-section
324+
// markup that overflows the modal height. Three-class selector
325+
// beats `.popup-modal.is--visible` so the `display: flex`
326+
// wins on specificity.
327+
&.is--visible {
328+
display: flex;
329+
flex-direction: column;
330+
}
331+
#message {
332+
overflow-y: auto;
333+
flex: 1 1 auto;
334+
min-height: 0;
335+
}
336+
.buttons {
337+
flex: 0 0 auto;
338+
}
339+
}
340+
341+
// The message dialog often shows multi-section explanatory prose
342+
// (e.g. the save-failure / read-only-filesystem help). Cap the
343+
// width so paragraphs wrap at a comfortable reading measure rather
344+
// than stretching the full viewport on a wide monitor.
345+
&[data-popup-modal="message"] {
346+
max-width: min(480px, 90vw);
322347
}
323348

324349
&.shadow {

0 commit comments

Comments
 (0)