Skip to content

fix: data preview table body overlapping pagination on load#29

Merged
HTHou merged 1 commit into
apache:mainfrom
CritasWang:fix/data-table-height-overlap
Jul 2, 2026
Merged

fix: data preview table body overlapping pagination on load#29
HTHou merged 1 commit into
apache:mainfrom
CritasWang:fix/data-table-height-overlap

Conversation

@CritasWang

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #27. The data preview table hardcoded its virtual-scroll viewport height (scroll.y = 480). After #27 added the timestamp-precision info banner above the table, that fixed height no longer matched the actual space left in the flex layout, so the table body overflowed onto the bottom pagination bar.

Fix

  • Wrap the table in a flex-1 container and use a ResizeObserver to compute scroll.y from the container's real client height, subtracting the measured header height plus a scrollbar/border reserve.
  • Re-measure after loading / data changes (nextTick), since the column toolbar, info banner, and pagination toggle visibility.
  • Make .ant-card-body a flex column so the wrapper's flex-1 receives the real remaining height.
  • Drop an unused Spin import.

This adapts automatically to any future elements added above or below the table, instead of relying on a magic constant.

Testing

  • pnpm build (vue-tsc + vite) passes.
  • Verified in the browser: table body no longer overlaps the pagination bar, and the layout re-fits correctly on load, data change, and window resize.

The data preview table hardcoded the virtual-scroll viewport height
(scroll.y = 480). After apache#27 added the timestamp-precision info banner
above the table, the fixed height no longer matched the actual space
left in the flex layout, so the table body overflowed onto the bottom
pagination bar.

Replace the hardcoded height with a measured one: wrap the table in a
flex-1 container and use a ResizeObserver to compute scroll.y from the
container's real client height, subtracting the measured header height
plus a scrollbar/border reserve. Re-measure after loading/data changes
(nextTick) since the column toolbar, info banner and pagination toggle
visibility. This adapts automatically to any future elements added
above or below the table instead of relying on a magic constant.

Also make .ant-card-body a flex column so the wrapper's flex-1 receives
the real remaining height, and drop an unused Spin import.
@HTHou
HTHou merged commit 5474759 into apache:main Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants