feat(ui): error & state UX (F4) #29

Merged
developer merged 3 commits from feature/ui-finalize-f4-error-ux into development 2026-05-22 11:53:16 +00:00
Showing only changes of commit 35e27c5aec - Show all commits
+11
View File
@@ -25,7 +25,18 @@ export function sheetDismiss(
let opts = options;
const handle = node.querySelector<HTMLElement>("[data-sheet-handle]") ?? node;
// The sheet stays mounted on desktop but is hidden by a media query
// (`display: none`); the document-level tap-outside listener fires
// regardless of that, so it must no-op while the sheet is not shown,
// or any click would dismiss the current selection. `offsetParent` is
// unreliable here (it is null for `position: fixed`), so check the
// computed display directly.
function isHidden(): boolean {
return getComputedStyle(node).display === "none";
}
function onDocumentPointerDown(event: PointerEvent): void {
if (isHidden()) return;
const target = event.target;
if (target instanceof Node && node.contains(target)) return;
opts.onDismiss();