fix: ios safari mobile dropdown and click bubbling issues resolved with global closer and native details
All checks were successful
Build MIPS Binary / build (push) Successful in 5m45s
All checks were successful
Build MIPS Binary / build (push) Successful in 5m45s
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta
|
<meta
|
||||||
name="viewport"
|
name="viewport"
|
||||||
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover"
|
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"
|
||||||
/>
|
/>
|
||||||
<title>VibeTorrent</title>
|
<title>VibeTorrent</title>
|
||||||
|
|
||||||
@@ -187,6 +187,17 @@
|
|||||||
|
|
||||||
<!-- Service Worker Registration & PWA Setup -->
|
<!-- Service Worker Registration & PWA Setup -->
|
||||||
<script>
|
<script>
|
||||||
|
// Global Dropdown Closer for iOS/Mobile
|
||||||
|
document.addEventListener('click', function(event) {
|
||||||
|
const details = document.querySelectorAll('details[open]');
|
||||||
|
details.forEach(detail => {
|
||||||
|
// Eğer tıklanan yer bu details'in içinde değilse kapat
|
||||||
|
if (!detail.contains(event.target)) {
|
||||||
|
detail.removeAttribute('open');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, true); // Use capture phase for better mobile support
|
||||||
|
|
||||||
if ("serviceWorker" in navigator) {
|
if ("serviceWorker" in navigator) {
|
||||||
window.addEventListener("load", () => {
|
window.addEventListener("load", () => {
|
||||||
navigator.serviceWorker
|
navigator.serviceWorker
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ pub fn StatusBar() -> impl IntoView {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// Refs for click outside detection
|
// Refs for click outside detection (Handled globally via JS in index.html for better iOS support)
|
||||||
let down_details_ref = create_node_ref::<html::Details>();
|
let down_details_ref = create_node_ref::<html::Details>();
|
||||||
let up_details_ref = create_node_ref::<html::Details>();
|
let up_details_ref = create_node_ref::<html::Details>();
|
||||||
let theme_details_ref = create_node_ref::<html::Details>();
|
let theme_details_ref = create_node_ref::<html::Details>();
|
||||||
@@ -109,10 +109,6 @@ pub fn StatusBar() -> impl IntoView {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let _ = on_click_outside(down_details_ref, move |_| close_details(down_details_ref));
|
|
||||||
let _ = on_click_outside(up_details_ref, move |_| close_details(up_details_ref));
|
|
||||||
let _ = on_click_outside(theme_details_ref, move |_| close_details(theme_details_ref));
|
|
||||||
|
|
||||||
view! {
|
view! {
|
||||||
<div class="fixed bottom-0 left-0 right-0 h-8 min-h-8 bg-base-200 border-t border-base-300 flex items-center px-4 text-xs gap-4 text-base-content/70 z-[99] cursor-pointer">
|
<div class="fixed bottom-0 left-0 right-0 h-8 min-h-8 bg-base-200 border-t border-base-300 flex items-center px-4 text-xs gap-4 text-base-content/70 z-[99] cursor-pointer">
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user