diff --git a/src/composables/useFillHeight.js b/src/composables/useFillHeight.js index 1863a4b..9ccf2d0 100644 --- a/src/composables/useFillHeight.js +++ b/src/composables/useFillHeight.js @@ -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(() => {