Fix modal backdrop still fading out when the first modal is closing even with additional modals on top
This commit is contained in:
parent
fca89aaaa6
commit
6b94437b89
|
@ -10,11 +10,11 @@
|
|||
|
||||
<template>
|
||||
<div class="bd-modals-container">
|
||||
<div v-for="(modal, index) in modals.stack" :key="`bd-modal-${index}`">
|
||||
<div class="bd-backdrop" :class="{'bd-backdrop-out': modal.closing}" :style="{opacity: index === 0 ? undefined : 0}"></div>
|
||||
<div v-for="(modal, index) in modals.stack" :key="`bd-modal-${modal.id}`">
|
||||
<div class="bd-backdrop" :class="{'bd-backdrop-out': closing}" :style="{opacity: index === 0 ? undefined : 0}"></div>
|
||||
<div class="bd-modal-wrap" :style="{transform: `scale(${downscale(index + 1, 0.2)})`, opacity: downscale(index + 1, 1)}">
|
||||
<div class="bd-modal-close-area" @click="closeModal(modal)"></div>
|
||||
<component :is="modal.component" />
|
||||
<keep-alive><component :is="modal.component" /></keep-alive>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -37,6 +37,11 @@
|
|||
eventListener: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
closing() {
|
||||
return !this.modals.stack.find(m => !m.closing);
|
||||
}
|
||||
},
|
||||
created() {
|
||||
Events.on('bd-refresh-modals', this.eventListener = () => {
|
||||
this.$forceUpdate();
|
||||
|
|
Loading…
Reference in New Issue