Show save/error status inside the open widget dialog, not behind it
showStatus() always wrote to the page-level #result div, which sits behind a <dialog>'s backdrop -- a save inside a widget's gear-icon dialog produced a message the user couldn't see without closing the dialog first. It now prefers a .dialog-result element inside whichever <dialog> is currently open, falling back to #result everywhere else. The dialog is a flex column with its body scrolling independently so .dialog-result stays pinned as a visible footer regardless of scroll position -- otherwise a save message on a long form (e.g. the calendar dialog) could land off-screen below the fold with no visible feedback at all.
This commit is contained in:
@@ -402,6 +402,13 @@ button.secondary:hover { background: var(--surface-alt); }
|
||||
background: var(--surface);
|
||||
color: var(--text);
|
||||
box-shadow: var(--shadow-hover);
|
||||
/* #widget-dialog-body scrolls on its own (min-height: 0 is what lets a
|
||||
flex child actually shrink/scroll instead of forcing the dialog
|
||||
past max-height) so .dialog-result stays pinned as a visible footer
|
||||
regardless of scroll position -- otherwise a save message can land
|
||||
off-screen below a long form with no visible feedback at all. */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
#widget-dialog::backdrop { background: var(--overlay); }
|
||||
#widget-dialog-close {
|
||||
@@ -414,8 +421,11 @@ button.secondary:hover { background: var(--surface-alt); }
|
||||
z-index: 1;
|
||||
}
|
||||
.dialog-title { margin: 0 40px 16px 0; font-size: 18px; }
|
||||
#widget-dialog-body { overflow-y: auto; min-height: 0; }
|
||||
#widget-dialog-body .card { box-shadow: none; }
|
||||
#widget-dialog-body .card:first-child { margin-top: 0; }
|
||||
.dialog-result { flex: none; }
|
||||
.dialog-result:not(:empty) { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
|
||||
|
||||
code {
|
||||
background: var(--surface-alt);
|
||||
|
||||
Reference in New Issue
Block a user