Skip to content

Commit f4f21df

Browse files
authored
Merge pull request #722 from bettysteger/main
fix(BModal): dispose modal before unmount
2 parents 4750442 + 1c54484 commit f4f21df

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/bootstrap-vue-3/src/components/BModal.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
<script setup lang="ts">
8686
// import type {BModalEmits, BModalProps} from '../types/components'
8787
import {Modal} from 'bootstrap'
88-
import {computed, nextTick, onMounted, ref, toRef, watch} from 'vue'
88+
import { computed, nextTick, onBeforeUnmount, onMounted, ref, toRef, watch} from 'vue'
8989
import {useBooleanish, useEventListener, useId} from '../composables'
9090
import type {Booleanish, ClassValue, ColorVariant, InputSize} from '../types'
9191
import BButton from './BButton/BButton.vue'
@@ -326,6 +326,11 @@ onMounted(() => {
326326
}
327327
})
328328
329+
onBeforeUnmount((): void => {
330+
instance.value?.dispose()
331+
instance.value = undefined
332+
})
333+
329334
watch(
330335
() => props.noCloseOnBackdrop,
331336
(newValue) => {

0 commit comments

Comments
 (0)