aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-05-22 14:04:16 +0000
committerFuwn <[email protected]>2026-05-22 14:04:16 +0000
commit8574a97e7bbf2d2a67dc5c743f4d1eb67610e715 (patch)
treed022a0e15f896da17000a78ff2207e1dfee8a749 /src
parentfix(lists): stop slot buttons from toggling the list details (diff)
downloaddue.moe-8574a97e7bbf2d2a67dc5c743f4d1eb67610e715.tar.xz
due.moe-8574a97e7bbf2d2a67dc5c743f4d1eb67610e715.zip
fix(layout): preserve list panel when clicking action buttons in summaryHEADmain
The global animateDetails handler in +layout.svelte runs on every window click, unconditionally finding the nearest <summary>, preventDefault'ing the native toggle, and manually toggling the parent <details>. That left no way for child handlers to opt out -- clicking Roulette or Refresh inside the list title still toggled the panel. Skip the takeover (and stop the native toggle) when the click target is an interactive element. Reverts the now-unneeded slot wrapper in ListTitle from 0d46fa54.
Diffstat (limited to 'src')
-rw-r--r--src/lib/List/ListTitle.svelte7
-rw-r--r--src/routes/+layout.svelte9
2 files changed, 9 insertions, 7 deletions
diff --git a/src/lib/List/ListTitle.svelte b/src/lib/List/ListTitle.svelte
index 1af962e5..2e9181d0 100644
--- a/src/lib/List/ListTitle.svelte
+++ b/src/lib/List/ListTitle.svelte
@@ -29,12 +29,7 @@ export let hideCount = false;
{/if}
<small class="opaque list-title-time">{time ? time.toFixed(3) : '...'}s</small>
{/if}
- <span
- role="presentation"
- onclick={(event) => event.preventDefault()}
- >
- <slot />
- </span>
+ <slot />
{#if progress !== undefined}
<button class="badge unclickable-button button-badge badge-info">
{progress.toFixed(0)}%
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index 9ad33ca9..71d74adb 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -143,8 +143,15 @@ const handleScroll = () => {
const detailsAnimations = new WeakMap<HTMLDetailsElement, Animation>();
const animateDetails = (e: MouseEvent) => {
- const summary = (e.target as HTMLElement | null)?.closest("summary");
+ const target = e.target as HTMLElement | null;
+ const summary = target?.closest("summary");
if (!summary) return;
+
+ if (target?.closest("button, a, input, select, textarea, label")) {
+ e.preventDefault();
+ return;
+ }
+
const details = summary.parentElement as HTMLDetailsElement | null;
if (!details || details.tagName !== "DETAILS") return;
if (reducesMotion()) return;