diff --git a/apps/desktop/src/components/grid/DataGrid.vue b/apps/desktop/src/components/grid/DataGrid.vue index 1485474cc7..5d5af30ef9 100644 --- a/apps/desktop/src/components/grid/DataGrid.vue +++ b/apps/desktop/src/components/grid/DataGrid.vue @@ -4883,7 +4883,16 @@ function drawCanvasGrid() { }); } -watch(useCanvasGridRows, () => nextTick(attachCanvasResizeObserver), { immediate: true }); +watch( + [useCanvasGridRows, hasVisibleRows], + () => { + // When an empty table gets its first pending row, the canvas scroller is created by + // the v-if branch after the original mount-time observer attempt has already no-op'd. + // Reattach after that branch mounts so the canvas/overlay get real viewport dimensions. + nextTick(attachCanvasResizeObserver); + }, + { immediate: true }, +); watch(showDataGridTopbar, () => nextTick(observeDataGridTopbarWidth), { immediate: true }); watch( [