From 14f811fd79a59c20f912be9fb5cfabaff97515c6 Mon Sep 17 00:00:00 2001 From: spinline Date: Fri, 6 Feb 2026 17:19:47 +0300 Subject: [PATCH] fix: convert sort dropdown to signal-based for iOS Safari --- frontend/public/tailwind.css | 34 +++-------------- frontend/src/components/torrent/table.rs | 47 +++++++++++++++--------- 2 files changed, 36 insertions(+), 45 deletions(-) diff --git a/frontend/public/tailwind.css b/frontend/public/tailwind.css index 585cb49..623eb0d 100644 --- a/frontend/public/tailwind.css +++ b/frontend/public/tailwind.css @@ -1328,34 +1328,6 @@ --toast-x: 0; } } - .dropdown-end { - @layer daisyui.l1.l2 { - --anchor-h: span-left; - :where(.dropdown-content) { - inset-inline-end: calc(0.25rem * 0); - translate: 0 0; - [dir="rtl"] & { - translate: 0 0; - } - } - &.dropdown-left { - --anchor-h: left; - --anchor-v: span-top; - .dropdown-content { - top: auto; - bottom: calc(0.25rem * 0); - } - } - &.dropdown-right { - --anchor-h: right; - --anchor-v: span-top; - .dropdown-content { - top: auto; - bottom: calc(0.25rem * 0); - } - } - } - } .toast-bottom { @layer daisyui.l1.l2 { top: auto; @@ -1363,6 +1335,9 @@ --toast-y: 0; } } + .top-full { + top: 100%; + } .right-0 { right: calc(var(--spacing) * 0); } @@ -1596,6 +1571,9 @@ gap: calc(0.25rem * 2); } } + .mt-1 { + margin-top: calc(var(--spacing) * 1); + } .mt-2 { margin-top: calc(var(--spacing) * 2); } diff --git a/frontend/src/components/torrent/table.rs b/frontend/src/components/torrent/table.rs index b8bce12..03a8918 100644 --- a/frontend/src/components/torrent/table.rs +++ b/frontend/src/components/torrent/table.rs @@ -152,6 +152,17 @@ pub fn TorrentTable() -> impl IntoView { } }; + // Signal-based sort dropdown for mobile + let (sort_open, set_sort_open) = create_signal(false); + let sort_skip_close = store_value(false); + let _ = window_event_listener(ev::click, move |_| { + if sort_skip_close.get_value() { + sort_skip_close.set_value(false); + return; + } + set_sort_open.set(false); + }); + let sort_arrow = move |col: SortColumn| { if sort_col.get() == col { match sort_dir.get() { @@ -325,21 +336,31 @@ pub fn TorrentTable() -> impl IntoView {
"Torrents" -