fix: ensure useFillHeight recalculates when element appears (v-if)

This commit is contained in:
2026-02-28 17:09:42 +00:00
parent c8f9dfb37e
commit 35c5ff4c51

View File

@@ -1,4 +1,4 @@
import { onMounted, onUnmounted, ref, nextTick } from 'vue'
import { onMounted, onUnmounted, ref, nextTick, watch } from 'vue'
import { UI_CONFIG } from '../config/ui'
export function useFillHeight(elementRef, extraMargin = 0) {
@@ -29,6 +29,13 @@ export function useFillHeight(elementRef, extraMargin = 0) {
// Also update after a short delay to ensure layout is settled (e.g. sidebar transitions)
setTimeout(updateHeight, 300)
// Watch for element appearing (v-if) or changing
watch(elementRef, () => {
nextTick(updateHeight)
// Additional update for layout stability
setTimeout(updateHeight, 100)
})
})
onUnmounted(() => {