fix(modal): keep confirm dialog above other modals
Deploy banu-front / deploy (push) Successful in 1m47s
Deploy banu-front / deploy (push) Successful in 1m47s
ConfirmModal mounts once at the app root, so its Teleport anchor in <body> is created before page-level modals like TermDetailsModal. With an identical z-index, later-mounted modals ended up stacking on top of it, hiding the confirmation prompt (e.g. confirming the new remove-student-from-term action). Adds a configurable zIndex prop to BasicModal and gives ConfirmModal a higher value so it always shows on top regardless of mount order.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<Teleport to="body">
|
<Teleport to="body">
|
||||||
<Transition name="fade-scale" @after-enter="onOpened" @after-leave="onClosed">
|
<Transition name="fade-scale" @after-enter="onOpened" @after-leave="onClosed">
|
||||||
<div v-if="isOpen" class="basic-modal" @click="onBackdropClick">
|
<div v-if="isOpen" class="basic-modal" :style="{ zIndex }" @click="onBackdropClick">
|
||||||
<div class="basic-modal__container" :style="containerStyle" @click.stop>
|
<div class="basic-modal__container" :style="containerStyle" @click.stop>
|
||||||
<div class="basic-modal__card scrollbar-thin">
|
<div class="basic-modal__card scrollbar-thin">
|
||||||
<header v-if="hasHeader" class="basic-modal__header">
|
<header v-if="hasHeader" class="basic-modal__header">
|
||||||
@@ -43,6 +43,7 @@ const props = defineProps({
|
|||||||
width: { type: String, default: '' },
|
width: { type: String, default: '' },
|
||||||
maxWidth: { type: String, default: '98%' },
|
maxWidth: { type: String, default: '98%' },
|
||||||
minWidth: { type: String, default: '85%' },
|
minWidth: { type: String, default: '85%' },
|
||||||
|
zIndex: { type: [Number, String], default: 50 },
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits(['open', 'close'])
|
const emit = defineEmits(['open', 'close'])
|
||||||
@@ -101,7 +102,6 @@ onBeforeUnmount(() => window.removeEventListener('keydown', onKeydown))
|
|||||||
.basic-modal {
|
.basic-modal {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
inset: 0;
|
inset: 0;
|
||||||
z-index: 50;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<BasicModal min-width="0" max-width="640px" width="95%" :show-close-button="false">
|
<BasicModal min-width="0" max-width="640px" width="95%" :show-close-button="false" :z-index="60">
|
||||||
<template #default="{ data }">
|
<template #default="{ data }">
|
||||||
<div class="confirm-modal">
|
<div class="confirm-modal">
|
||||||
<h3 class="confirm-modal__title">{{ data?.title || 'تأیید حذف' }}</h3>
|
<h3 class="confirm-modal__title">{{ data?.title || 'تأیید حذف' }}</h3>
|
||||||
|
|||||||
Reference in New Issue
Block a user