Keep dialogs within the viewport height
BaseModal is now capped at the viewport height: header and footer stay visible and the body scrolls. Wide dialogs make their body a flex column so the macro/function editor fills it and its reference list scrolls on its own on small screens. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -48,11 +48,16 @@ watch(
|
|||||||
border: 1px solid var(--border);
|
border: 1px solid var(--border);
|
||||||
box-shadow: var(--shadow);
|
box-shadow: var(--shadow);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
/* never taller than the viewport: header/footer stay put, the body scrolls */
|
||||||
|
max-height: calc(100dvh - 32px);
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
.modal.wide {
|
.modal.wide {
|
||||||
width: min(920px, calc(100vw - 32px));
|
width: min(920px, calc(100vw - 32px));
|
||||||
}
|
}
|
||||||
header {
|
header {
|
||||||
|
flex: none;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
@@ -73,8 +78,18 @@ h2 {
|
|||||||
.body {
|
.body {
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
|
flex: 1 1 auto;
|
||||||
|
min-height: 0;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
/* wide dialogs lay out one full-height child (e.g. an editor + side panel)
|
||||||
|
that shrinks with the viewport and scrolls its own parts */
|
||||||
|
.modal.wide .body {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
footer {
|
footer {
|
||||||
|
flex: none;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
|
|||||||
Reference in New Issue
Block a user