fix : scroll-lock du MalioDrawer réellement partagé entre instances (drawers empilés)

This commit is contained in:
2026-05-21 16:56:38 +02:00
parent 09059ad0c6
commit 09c814f9f7
2 changed files with 37 additions and 4 deletions

View File

@@ -95,9 +95,6 @@ import { twMerge } from 'tailwind-merge'
defineOptions({ name: 'MalioDrawer', inheritAttrs: false })
// Module-level counter shared across all drawer instances to support stacked drawers.
let openDrawerCount = 0
const props = withDefaults(
defineProps<{
id?: string
@@ -257,6 +254,11 @@ function close() {
}
</script>
<script lang="ts">
// Shared across all MalioDrawer instances: only the last open drawer releases the body scroll-lock.
let openDrawerCount = 0
</script>
<style scoped>
.drawer-right-enter-active,
.drawer-right-leave-active,