From e5d9950429e66728118a8da3d3537706219b6cc3 Mon Sep 17 00:00:00 2001 From: Hayden <48267247+hayden-fr@users.noreply.github.com> Date: Sat, 1 Feb 2025 11:55:58 +0800 Subject: [PATCH] fix: overlay zIndex (#109) --- src/components/GlobalDialogStack.vue | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/GlobalDialogStack.vue b/src/components/GlobalDialogStack.vue index 78197f9..c837dd5 100644 --- a/src/components/GlobalDialogStack.vue +++ b/src/components/GlobalDialogStack.vue @@ -11,7 +11,8 @@ :max-width="item.maxWidth" :min-height="item.minHeight" :max-height="item.maxHeight" - :z-index="baseZIndex + index + 1" + :auto-z-index="false" + :pt:mask:style="{ zIndex: baseZIndex + index + 1 }" :pt:root:onMousedown="() => rise(item)" @hide="() => close(item)" > @@ -43,7 +44,7 @@ import ResponseDialog from 'components/ResponseDialog.vue' import { useDialog } from 'hooks/dialog' import Button from 'primevue/button' import { usePrimeVue } from 'primevue/config' -import { computed } from 'vue' +import { computed, onMounted } from 'vue' const { stack, rise, close } = useDialog() @@ -52,4 +53,10 @@ const { config } = usePrimeVue() const baseZIndex = computed(() => { return config.zIndex?.modal ?? 1100 }) + +onMounted(() => { + for (const key in config.zIndex) { + config.zIndex[key] = baseZIndex.value + } +})