From 235abead0333f539597dd71e3b68f62d460caeeb Mon Sep 17 00:00:00 2001 From: Matt Toohey Date: Wed, 15 Jul 2026 12:01:21 +1000 Subject: [PATCH] fix(dialog): stop dialogs from clearing text selection on mouseup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Selecting text in a note dialog (or any bits-ui dialog) collapsed the selection the moment the mouse was released. bits-ui's TextSelectionLayer locks selection overflow by rewriting user-select on and the dialog content at pointerdown, then restoring both at pointerup — and WKWebView (the Tauri webview) drops the live selection whenever those user-select styles change. Disable the layer via preventOverflowTextSelection={false} in the shared dialog and alert-dialog content wrappers. The full-screen overlay already covers the page behind the modal, so the overflow the layer guarded against has nothing visible to leak into. Callers can still re-enable it per-dialog since the prop is spread before restProps. Co-Authored-By: Claude Fable 5 Signed-off-by: Matt Toohey --- .../ui/alert-dialog/alert-dialog-content.svelte | 6 ++++++ .../src/lib/components/ui/dialog/dialog-content.svelte | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/apps/staged/src/lib/components/ui/alert-dialog/alert-dialog-content.svelte b/apps/staged/src/lib/components/ui/alert-dialog/alert-dialog-content.svelte index 23f6978b..92680b41 100644 --- a/apps/staged/src/lib/components/ui/alert-dialog/alert-dialog-content.svelte +++ b/apps/staged/src/lib/components/ui/alert-dialog/alert-dialog-content.svelte @@ -19,6 +19,11 @@ + diff --git a/apps/staged/src/lib/components/ui/dialog/dialog-content.svelte b/apps/staged/src/lib/components/ui/dialog/dialog-content.svelte index 47a03b07..759cc10e 100644 --- a/apps/staged/src/lib/components/ui/dialog/dialog-content.svelte +++ b/apps/staged/src/lib/components/ui/dialog/dialog-content.svelte @@ -91,6 +91,13 @@ + e.preventDefault()} onpointerdown={handlePointerDown} + preventOverflowTextSelection={false} {...restProps} > {@render children?.()}