Skip to content

Commit af2e95b

Browse files
committed
feat(BModal): 🐛 warning prop lazy does not currently work due to a constrant with updating to remove bootstrap js
feat(BModal): remove bootstrapjs
1 parent 0884d69 commit af2e95b

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

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

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
<teleport to="body">
33
<b-transition
44
:no-fade="true"
5-
enter-to-class="show"
5+
:trans-props="{enterToClass: 'show'}"
66
@before-enter="onBeforeEnter"
77
@after-enter="onAfterEnter"
88
@before-leave="onBeforeLeave"
9+
@leave="onLeave"
910
@after-leave="onAfterLeave"
1011
>
1112
<div
@@ -14,13 +15,13 @@
1415
ref="element"
1516
class="modal"
1617
:class="modalClasses"
17-
style="display: block"
18+
:style="{display: 'block'}"
1819
tabindex="-1"
1920
v-bind="$attrs"
2021
@keyup.esc="onEsc"
2122
>
2223
<div class="modal-dialog" :class="modalDialogClasses">
23-
<div v-if="renderLazy" class="modal-content" :class="contentClass">
24+
<div class="modal-content" :class="contentClass">
2425
<div v-if="!hideHeaderBoolean" class="modal-header" :class="headerClasses">
2526
<slot name="header">
2627
<component :is="titleTag" class="modal-title" :class="titleClasses">
@@ -191,10 +192,12 @@ const emit = defineEmits<BModalEmits>()
191192
192193
const slots = useSlots()
193194
195+
const isActive = ref(false)
196+
194197
const computedId = useId(toRef(props, 'id'), 'modal')
195198
196199
const busyBoolean = useBooleanish(toRef(props, 'busy'))
197-
const lazyBoolean = useBooleanish(toRef(props, 'lazy'))
200+
// const lazyBoolean = useBooleanish(toRef(props, 'lazy'))
198201
const cancelDisabledBoolean = useBooleanish(toRef(props, 'cancelDisabled'))
199202
const centeredBoolean = useBooleanish(toRef(props, 'centered'))
200203
const hideBackdropBoolean = useBooleanish(toRef(props, 'hideBackdrop'))
@@ -212,12 +215,12 @@ const scrollableBoolean = useBooleanish(toRef(props, 'scrollable'))
212215
const titleSrOnlyBoolean = useBooleanish(toRef(props, 'titleSrOnly'))
213216
214217
const element = ref<HTMLElement | null>(null)
215-
const lazyLoadCompleted = ref(false)
216218
217219
const modalClasses = computed(() => [
218220
props.modalClass,
219221
{
220222
fade: !noFadeBoolean.value,
223+
show: isActive.value,
221224
},
222225
])
223226
@@ -268,12 +271,6 @@ const titleClasses = computed(() => [
268271
])
269272
const disableCancel = computed<boolean>(() => cancelDisabledBoolean.value || busyBoolean.value)
270273
const disableOk = computed<boolean>(() => okDisabledBoolean.value || busyBoolean.value)
271-
const renderLazy = computed(
272-
() =>
273-
!lazyBoolean.value ||
274-
(lazyBoolean.value && lazyLoadCompleted.value) ||
275-
(lazyBoolean.value && modelValueBoolean.value)
276-
)
277274
278275
const hide = () => emit('update:modelValue', false)
279276
@@ -284,8 +281,14 @@ const onEsc = (e: KeyboardEvent) => {
284281
}
285282
286283
const onBeforeEnter = () => emit('show')
287-
const onAfterEnter = () => emit('shown')
284+
const onAfterEnter = () => {
285+
isActive.value = true
286+
emit('shown')
287+
}
288288
const onBeforeLeave = () => emit('hide')
289+
const onLeave = () => {
290+
isActive.value = false
291+
}
289292
const onAfterLeave = () => emit('hidden')
290293
291294
watch(

0 commit comments

Comments
 (0)