fix(mobile): fix sort dropdown event handling
All checks were successful
Build MIPS Binary / build (push) Successful in 4m13s

This commit is contained in:
spinline
2026-02-08 03:46:34 +03:00
parent 275bb6e37a
commit 8baf01c77b

View File

@@ -343,7 +343,7 @@ pub fn TorrentTable() -> impl IntoView {
<Show when=move || sort_open.get()> <Show when=move || sort_open.get()>
<div <div
class="fixed inset-0 z-[98] cursor-default" class="fixed inset-0 z-[98] cursor-default"
on:pointerdown=move |_| set_sort_open.set(false) on:click=move |_| set_sort_open.set(false)
></div> ></div>
</Show> </Show>
@@ -354,7 +354,7 @@ pub fn TorrentTable() -> impl IntoView {
<div <div
role="button" role="button"
class="btn btn-ghost btn-xs gap-1 opacity-70 font-normal" class="btn btn-ghost btn-xs gap-1 opacity-70 font-normal"
on:pointerdown=move |e| { on:click=move |e| {
e.stop_propagation(); e.stop_propagation();
let cur = sort_open.get_untracked(); let cur = sort_open.get_untracked();
set_sort_open.set(!cur); set_sort_open.set(!cur);
@@ -383,20 +383,21 @@ pub fn TorrentTable() -> impl IntoView {
(SortColumn::AddedDate, "Date"), (SortColumn::AddedDate, "Date"),
]; ];
columns.into_iter().map(|(col, label)| { columns.into_iter().map(|(col, label)| {
let is_active = move || sort_col.get() == col; let is_active = move || sort_col.get() == col;
let current_dir = move || sort_dir.get(); let current_dir = move || sort_dir.get();
view! { view! {
<li> <li>
<button <button
class=move || if is_active() { "bg-primary/10 text-primary font-bold flex justify-between" } else { "flex justify-between" } class=move || if is_active() { "bg-primary/10 text-primary font-bold flex justify-between" } else { "flex justify-between" }
on:pointerdown=move |e| { on:click=move |e| {
e.stop_propagation(); e.prevent_default();
handle_sort(col); e.stop_propagation();
set_sort_open.set(false); handle_sort(col);
} set_sort_open.set(false);
> }
>
{label} {label}
<Show when=is_active fallback=|| ()> <Show when=is_active fallback=|| ()>
<span class="opacity-70 text-[10px]"> <span class="opacity-70 text-[10px]">