Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 24 additions & 17 deletions assets/css/builder.css
Original file line number Diff line number Diff line change
Expand Up @@ -2696,32 +2696,39 @@ os-checkbox-label.atfb-check {
button somewhere nobody could reach. Absolute against the body's
`position: relative` is exact at every window size.

No bottom padding: the sticky action bar below owns the bottom edge,
and padding under it would be 14px the bar could never cover. */
A flex column of exactly two things — the scroll region and the action
bar — rather than one scroller with a sticky bar inside it. Sticky kept
the bar in the scroll math, which produced both of its failure modes: a
window a few pixels shorter than the content scrolled by those few
pixels with nothing meaningful hidden, and a window taller than the
content left the bar floating at the end of the text instead of on the
window's edge. As a flex footer the bar is chrome: always on the bottom
edge, never part of what scrolls. */
position: absolute;
inset: 0;
display: flex;
flex-direction: column;
inline-size: auto;
max-block-size: none;
block-size: auto;
padding: 14px 16px 0;
overflow-y: auto;
display: block;
padding: 0;
overflow: hidden;
}

/* Save and Cancel ride the bottom of the scrollport rather than the bottom of
the content: in a window the person sizes themselves, "scroll to find Save"
is a chore the chrome can simply remove. Stretched across the host's padding
and given a top border + opaque background so content sliding under it reads
as under it.
/* The scrollable half. `min-block-size: 0` is what lets a flex child actually
shrink below its content and scroll, instead of stretching its parent. */
.atfb-valwin__scroll {
flex: 1 1 auto;
min-block-size: 0;
overflow-y: auto;
padding: 14px 16px;
}

`inset-block-end: 0`, exactly — a negative offset here parks part of the bar
past the scrollport edge, where the window body's `overflow: hidden` cuts
it in half. */
/* The fixed half: Save and Cancel on the window's bottom edge, top border and
opaque background so content scrolling beneath reads as beneath. */
.atfb-valwin--window .atfb-modal__actions {
position: sticky;
inset-block-end: 0;
margin-inline: -16px;
margin-block-start: 12px;
flex: 0 0 auto;
margin: 0;
padding: 10px 16px;
background: var( --atfb-bg );
border-block-start: 1px solid var( --atfb-border );
Expand Down
8 changes: 7 additions & 1 deletion assets/js/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -3102,7 +3102,13 @@ var allTerrainFormsBuilder = function(exports) {
autofocus: ".atfb-valwin__pane:not([hidden]) input, .atfb-valwin__pane:not([hidden]) textarea",
render: (body) => {
const host = el("div", { class: "atfa atfb-valwin atfb-valwin--window" });
buildEditor(host, options, state, close, "window");
const scroll = el("div", { class: "atfb-valwin__scroll" });
host.append(scroll);
buildEditor(scroll, options, state, close, "window");
const actions = scroll.querySelector(".atfb-modal__actions");
if (actions) {
host.append(actions);
}
body.append(host);
},
// Fires however the window closes — Save, Cancel, the title-bar X,
Expand Down
2 changes: 1 addition & 1 deletion assets/js/builder.min.js

Large diffs are not rendered by default.

16 changes: 15 additions & 1 deletion src/validation-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,22 @@ function openAsChildWindow( manager: ShellWindowManager, parentId: string, optio
autofocus: '.atfb-valwin__pane:not([hidden]) input, .atfb-valwin__pane:not([hidden]) textarea',
render: ( body ) => {
const host = el( 'div', { class: 'atfa atfb-valwin atfb-valwin--window' } );
const scroll = el( 'div', { class: 'atfb-valwin__scroll' } );

host.append( scroll );
buildEditor( scroll, options, state, close, 'window' );

// The action bar is chrome, not content. Out of the scroller and
// into the host's flex column, it sits on the window's bottom
// edge at every size — and stops counting toward the scroll
// height, so a window tall enough to show everything scrolls by
// exactly nothing.
const actions = scroll.querySelector( '.atfb-modal__actions' );

if ( actions ) {
host.append( actions );
}

buildEditor( host, options, state, close, 'window' );
body.append( host );
},
// Fires however the window closes — Save, Cancel, the title-bar X,
Expand Down
Loading