fix: Use touchstart event for mobile sidebar backdrop
This commit is contained in:
@@ -426,6 +426,9 @@
|
||||
.transform {
|
||||
transform: var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);
|
||||
}
|
||||
.cursor-default {
|
||||
cursor: default;
|
||||
}
|
||||
.cursor-pointer {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@@ -327,10 +327,12 @@ pub fn App() -> impl IntoView {
|
||||
// MOBILE SIDEBAR
|
||||
<div
|
||||
class={move || if show_mobile_sidebar.get() { "fixed inset-0 z-50 flex md:hidden" } else { "hidden" }}
|
||||
on:click=move |_| set_show_mobile_sidebar.set(false)
|
||||
on:click=move |_| ()
|
||||
>
|
||||
<div
|
||||
class="fixed inset-0 bg-black/60 backdrop-blur-sm transition-opacity cursor-pointer"
|
||||
class="fixed inset-0 bg-black/60 backdrop-blur-sm transition-opacity cursor-default"
|
||||
on:click=move |_| set_show_mobile_sidebar.set(false)
|
||||
on:touchstart=move |_| set_show_mobile_sidebar.set(false)
|
||||
></div>
|
||||
<aside
|
||||
class={format!("relative w-80 max-w-[85vw] h-full shadow-2xl p-6 flex flex-col animate-in slide-in-from-left duration-300 border-r {}", sidebar_bg)}
|
||||
|
||||
Reference in New Issue
Block a user