Skip to content

Commit 3bf5acb

Browse files
committed
fix(Toast): calc height on next tick
Resolves #4265
1 parent d37315c commit 3bf5acb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/runtime/components/Toast.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export interface ToastSlots {
6969
</script>
7070

7171
<script setup lang="ts">
72-
import { ref, computed, onMounted } from 'vue'
72+
import { ref, computed, onMounted, nextTick } from 'vue'
7373
import { ToastRoot, ToastTitle, ToastDescription, ToastAction, ToastClose, useForwardPropsEmits } from 'reka-ui'
7474
import { reactivePick } from '@vueuse/core'
7575
import { useAppConfig } from '#imports'
@@ -106,9 +106,9 @@ onMounted(() => {
106106
return
107107
}
108108
109-
setTimeout(() => {
110-
height.value = el.value.$el.getBoundingClientRect()?.height
111-
}, 0)
109+
nextTick(() => {
110+
height.value = el.value?.$el?.getBoundingClientRect()?.height
111+
})
112112
})
113113
114114
defineExpose({

0 commit comments

Comments
 (0)