@dnax/ui 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/QSidebar.vue +12 -0
- package/package.json +1 -1
- package/styles/main.css +15 -1
package/components/QSidebar.vue
CHANGED
|
@@ -113,6 +113,18 @@ onBeforeUnmount(() => {
|
|
|
113
113
|
if (typeof document !== "undefined") document.removeEventListener("keydown", onDocKeydown)
|
|
114
114
|
})
|
|
115
115
|
|
|
116
|
+
// Verrouille le scroll du body quand la sidebar offcanvas est ouverte : le body
|
|
117
|
+
// ne bouge plus en arrière-plan (et le swipe ne part pas sur la page)
|
|
118
|
+
watch(
|
|
119
|
+
() => !isStatic.value && open.value,
|
|
120
|
+
(locked) => {
|
|
121
|
+
if (typeof document !== "undefined") {
|
|
122
|
+
document.body.style.overflow = locked ? "hidden" : ""
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
{ immediate: true },
|
|
126
|
+
)
|
|
127
|
+
|
|
116
128
|
const rootClasses = computed(() =>
|
|
117
129
|
cn(
|
|
118
130
|
"q-sidebar",
|
package/package.json
CHANGED
package/styles/main.css
CHANGED
|
@@ -3621,8 +3621,13 @@ html.dark body {
|
|
|
3621
3621
|
transition:
|
|
3622
3622
|
transform 0.25s ease,
|
|
3623
3623
|
visibility 0.25s;
|
|
3624
|
-
/* Scroll vertical natif autorisé, gestes horizontaux (swipe pour fermer) au JS
|
|
3624
|
+
/* Scroll vertical natif autorisé, gestes horizontaux (swipe pour fermer) au JS.
|
|
3625
|
+
touch-action n'est PAS hérité → on l'applique à tous les descendants : le
|
|
3626
|
+
geste peut démarrer sur le contenu scrollable (.q-sidebar__content) sans que
|
|
3627
|
+
le navigateur ne prenne le swipe pour le body. */
|
|
3625
3628
|
touch-action: pan-y;
|
|
3629
|
+
/* Empêche le scroll-chaining : swiper la sidebar ne fait plus bouger le body */
|
|
3630
|
+
overscroll-behavior: contain;
|
|
3626
3631
|
/* Safe-area : encoche, barre d'accueil et côtés en paysage */
|
|
3627
3632
|
padding-top: 0;
|
|
3628
3633
|
padding-top: constant(safe-area-inset-top);
|
|
@@ -3635,6 +3640,13 @@ html.dark body {
|
|
|
3635
3640
|
padding-left: env(safe-area-inset-left);
|
|
3636
3641
|
}
|
|
3637
3642
|
|
|
3643
|
+
/* Tous les descendants (contenu scrollable, menu, boutons…) : gestes horizontaux
|
|
3644
|
+
au JS, scroll vertical natif uniquement */
|
|
3645
|
+
.q-sidebar--offcanvas,
|
|
3646
|
+
.q-sidebar--offcanvas * {
|
|
3647
|
+
touch-action: pan-y;
|
|
3648
|
+
}
|
|
3649
|
+
|
|
3638
3650
|
.q-sidebar--offcanvas.q-sidebar--right {
|
|
3639
3651
|
left: auto;
|
|
3640
3652
|
right: 0;
|
|
@@ -3702,6 +3714,8 @@ html.dark body {
|
|
|
3702
3714
|
overflow-y: auto;
|
|
3703
3715
|
padding: 8px;
|
|
3704
3716
|
scrollbar-width: thin;
|
|
3717
|
+
/* Le scroll du contenu ne doit pas se propager au body (swipe-to-close) */
|
|
3718
|
+
overscroll-behavior: contain;
|
|
3705
3719
|
}
|
|
3706
3720
|
|
|
3707
3721
|
.q-sidebar__footer {
|