From 35c5ff4c517f8c4b76828c6601dce4c291773cde Mon Sep 17 00:00:00 2001 From: Grzegorz Kucmierz Date: Sat, 28 Feb 2026 17:09:42 +0000 Subject: [PATCH] fix: ensure useFillHeight recalculates when element appears (v-if) --- src/composables/useFillHeight.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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(() => {