[web] Design re-check: the engine chip closes its popover, Show details on every pause, popover grammar, share links off while Caddy serves, renewal copy
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
onclose,
|
||||
escape = true,
|
||||
closable = true,
|
||||
toggle,
|
||||
children,
|
||||
footer,
|
||||
}: {
|
||||
@@ -26,6 +27,8 @@
|
||||
onclose: () => void;
|
||||
escape?: boolean;
|
||||
closable?: boolean;
|
||||
/** A popover's opener (a CSS selector): a click there is the opener's, which toggles it. */
|
||||
toggle?: string;
|
||||
children?: Snippet;
|
||||
footer?: Snippet;
|
||||
} = $props();
|
||||
@@ -53,7 +56,10 @@
|
||||
}
|
||||
};
|
||||
const down = (e: PointerEvent) => {
|
||||
if (!modal && escape && el && e.target instanceof Node && !el.contains(e.target)) onclose();
|
||||
if (!modal && escape && el && e.target instanceof Node && !el.contains(e.target)) {
|
||||
if (toggle && e.target instanceof Element && e.target.closest(toggle)) return;
|
||||
onclose();
|
||||
}
|
||||
};
|
||||
document.addEventListener("keydown", key);
|
||||
// On the next turn, so the click that opened the popover does not close it.
|
||||
|
||||
Reference in New Issue
Block a user