Fix mobile dropdown interaction: Revert to pointerdown with stop_propagation and use overlay for reliable closing
All checks were successful
Build MIPS Binary / build (push) Successful in 3m57s
All checks were successful
Build MIPS Binary / build (push) Successful in 3m57s
This commit is contained in:
@@ -132,7 +132,7 @@ pub fn StatusBar() -> impl IntoView {
|
||||
<Show when=move || active_dropdown.get() != 0>
|
||||
<div
|
||||
class="fixed inset-0 z-[98] cursor-default"
|
||||
on:click=move |_| close_all()
|
||||
on:pointerdown=move |_| close_all()
|
||||
></div>
|
||||
</Show>
|
||||
|
||||
@@ -143,7 +143,10 @@ pub fn StatusBar() -> impl IntoView {
|
||||
<div
|
||||
class="flex items-center gap-2 cursor-pointer hover:text-primary transition-colors select-none"
|
||||
title="Global Download Speed - Click to Set Limit"
|
||||
on:click=move |_| toggle(1)
|
||||
on:pointerdown=move |e| {
|
||||
e.stop_propagation();
|
||||
toggle(1);
|
||||
}
|
||||
>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M19.5 13.5L12 21m0 0l-7.5-7.5M12 21V3" />
|
||||
@@ -170,7 +173,8 @@ pub fn StatusBar() -> impl IntoView {
|
||||
<li>
|
||||
<button
|
||||
class=move || if is_active() { "bg-primary/10 text-primary font-bold text-xs flex justify-between" } else { "text-xs flex justify-between" }
|
||||
on:click=move |_| {
|
||||
on:pointerdown=move |e| {
|
||||
e.stop_propagation();
|
||||
set_limit("down", val);
|
||||
close_all();
|
||||
}
|
||||
@@ -192,7 +196,10 @@ pub fn StatusBar() -> impl IntoView {
|
||||
<div
|
||||
class="flex items-center gap-2 cursor-pointer hover:text-primary transition-colors select-none"
|
||||
title="Global Upload Speed - Click to Set Limit"
|
||||
on:click=move |_| toggle(2)
|
||||
on:pointerdown=move |e| {
|
||||
e.stop_propagation();
|
||||
toggle(2);
|
||||
}
|
||||
>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M4.5 10.5L12 3m0 0l7.5 7.5M12 3v18" />
|
||||
@@ -219,7 +226,8 @@ pub fn StatusBar() -> impl IntoView {
|
||||
<li>
|
||||
<button
|
||||
class=move || if is_active() { "bg-primary/10 text-primary font-bold text-xs flex justify-between" } else { "text-xs flex justify-between" }
|
||||
on:click=move |_| {
|
||||
on:pointerdown=move |e| {
|
||||
e.stop_propagation();
|
||||
set_limit("up", val);
|
||||
close_all();
|
||||
}
|
||||
@@ -241,7 +249,10 @@ pub fn StatusBar() -> impl IntoView {
|
||||
<div
|
||||
class="btn btn-ghost btn-xs btn-square"
|
||||
title="Change Theme"
|
||||
on:click=move |_| toggle(3)
|
||||
on:pointerdown=move |e| {
|
||||
e.stop_propagation();
|
||||
toggle(3);
|
||||
}
|
||||
>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M9.53 16.122a3 3 0 0 0-5.78 1.128 2.25 2.25 0 0 1-2.4 2.245 4.5 4.5 0 0 0 8.4-2.245c0-.399-.078-.78-.22-1.128Zm0 0a15.998 15.998 0 0 0 3.388-1.62m-5.043-.025a15.994 15.994 0 0 1 1.622-3.395m3.42 3.42a15.995 15.995 0 0 0 4.764-4.648l3.876-5.814a1.151 1.151 0 0 0-1.597-1.597L14.146 6.32a15.996 15.996 0 0 0-4.649 4.763m3.42 3.42a6.776 6.776 0 0 0-3.42-3.42" />
|
||||
@@ -261,7 +272,8 @@ pub fn StatusBar() -> impl IntoView {
|
||||
<li>
|
||||
<button
|
||||
class=move || if current_theme.get() == theme { "bg-primary/10 text-primary font-bold text-xs capitalize" } else { "text-xs capitalize" }
|
||||
on:click=move |_| {
|
||||
on:pointerdown=move |e| {
|
||||
e.stop_propagation();
|
||||
set_current_theme.set(theme.to_string());
|
||||
if let Some(win) = web_sys::window() {
|
||||
if let Some(doc) = win.document() {
|
||||
@@ -282,7 +294,6 @@ pub fn StatusBar() -> impl IntoView {
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<button
|
||||
class="btn btn-ghost btn-xs btn-square"
|
||||
title="Settings & Notification Permissions"
|
||||
|
||||
@@ -329,7 +329,7 @@ pub fn TorrentTable() -> impl IntoView {
|
||||
<Show when=move || sort_open.get()>
|
||||
<div
|
||||
class="fixed inset-0 z-[98] cursor-default"
|
||||
on:click=move |_| set_sort_open.set(false)
|
||||
on:pointerdown=move |_| set_sort_open.set(false)
|
||||
></div>
|
||||
</Show>
|
||||
|
||||
@@ -340,7 +340,8 @@ pub fn TorrentTable() -> impl IntoView {
|
||||
<div
|
||||
role="button"
|
||||
class="btn btn-ghost btn-xs gap-1 opacity-70 font-normal"
|
||||
on:click=move |_| {
|
||||
on:pointerdown=move |e| {
|
||||
e.stop_propagation();
|
||||
let cur = sort_open.get_untracked();
|
||||
set_sort_open.set(!cur);
|
||||
}
|
||||
@@ -353,6 +354,7 @@ pub fn TorrentTable() -> impl IntoView {
|
||||
<ul
|
||||
class="absolute top-full right-0 z-[100] menu p-2 shadow bg-base-100 rounded-box w-48 mt-1 border border-base-200 text-xs"
|
||||
style=move || if sort_open.get() { "display: block" } else { "display: none" }
|
||||
on:pointerdown=move |e| e.stop_propagation()
|
||||
>
|
||||
<li class="menu-title px-2 py-1 opacity-50 text-[10px] uppercase font-bold">"Sort By"</li>
|
||||
{
|
||||
@@ -374,7 +376,8 @@ pub fn TorrentTable() -> impl IntoView {
|
||||
<li>
|
||||
<button
|
||||
class=move || if is_active() { "bg-primary/10 text-primary font-bold flex justify-between" } else { "flex justify-between" }
|
||||
on:click=move |_| {
|
||||
on:pointerdown=move |e| {
|
||||
e.stop_propagation();
|
||||
handle_sort(col);
|
||||
set_sort_open.set(false);
|
||||
}
|
||||
@@ -397,8 +400,7 @@ pub fn TorrentTable() -> impl IntoView {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="overflow-y-auto p-3 pb-20 flex-1 grid grid-cols-1 content-start gap-3">
|
||||
{move || filtered_torrents().into_iter().map(|t| {
|
||||
<div class="overflow-y-auto p-3 pb-20 flex-1 grid grid-cols-1 content-start gap-3"> {move || filtered_torrents().into_iter().map(|t| {
|
||||
let progress_class = if t.percent_complete >= 100.0 { "progress-success" } else { "progress-primary" };
|
||||
let status_str = format!("{:?}", t.status);
|
||||
let status_badge_class = match t.status {
|
||||
|
||||
Reference in New Issue
Block a user