Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3950,6 +3950,13 @@ function bindEvents(): void {
// Keep only the table scrolling: refit on viewport changes and whenever
// the content above the table (wrapping toolbar, panels) changes height.
window.addEventListener('resize', fitTableHeight);
window.addEventListener('load', fitTableHeight);
if (document.fonts && document.fonts.ready) void document.fonts.ready.then(fitTableHeight); // the first fit ran before the fonts were in
if (typeof ResizeObserver === 'function') {
// a block above the table that shrinks after the first fit does not change the page height (min-h-screen), only its own size tells
const above = new ResizeObserver(() => fitTableHeight());
document.querySelectorAll('main > *').forEach(child => { if (!child.contains(el.tableScroll)) above.observe(child, { box: 'border-box' }); });
}
if (typeof ResizeObserver === 'function') {
new ResizeObserver(() => fitTableHeight()).observe(document.body);
}
Expand Down
Loading