This commit is contained in:
Janus Knudsen 2025-07-29 23:17:52 +02:00
parent 2e50679602
commit a410088fa7
2 changed files with 17 additions and 9 deletions

View file

@ -331,23 +331,32 @@ export class ScrollManager {
// Calculate available height for scrollable content // Calculate available height for scrollable content
const availableHeight = containerRect.height - headerHeight; const availableHeight = containerRect.height - headerHeight;
// Calculate available width (container width minus time-axis and scrollbar)
const availableWidth = containerRect.width - 60 - 20; // 60px time-axis, 20px scrollbar
console.log('ScrollManager: Dynamic height calculation'); console.log('ScrollManager: Dynamic height calculation');
console.log('- Container height:', containerRect.height); console.log('- Container height:', containerRect.height);
console.log('- Navigation height:', navHeight); console.log('- Navigation height:', navHeight);
console.log('- Header height:', headerHeight); console.log('- Header height:', headerHeight);
console.log('- Available height:', availableHeight); console.log('- Available height:', availableHeight);
console.log('- Available width:', availableWidth);
// Set the height on scrollable content // Set the height and width on scrollable content
if (availableHeight > 0) { if (availableHeight > 0) {
this.scrollableContent.style.height = `${availableHeight}px`; this.scrollableContent.style.height = `${availableHeight}px`;
}
if (availableWidth > 0) {
this.scrollableContent.style.width = `${availableWidth}px`;
}
// Recalculate scroll bounds after height change // Recalculate scroll bounds after dimension changes
setTimeout(() => { setTimeout(() => {
this.calculateScrollBounds(); this.calculateScrollBounds();
this.calculateHorizontalScrollBounds();
this.updateHandlePosition(); this.updateHandlePosition();
this.updateHorizontalHandlePosition();
}, 0); }, 0);
} }
}
/** /**
* Hide native scrollbar while keeping scroll functionality * Hide native scrollbar while keeping scroll functionality

View file

@ -262,8 +262,7 @@ swp-scrollable-content {
scroll-behavior: smooth; scroll-behavior: smooth;
position: relative; position: relative;
display: grid; display: grid;
/* Height will be set dynamically by ScrollManager via ResizeObserver */ /* Height and width will be set dynamically by ScrollManager via ResizeObserver */
width: calc(100vw - 60px - 20px); /* Viewport width minus time-axis and scrollbar */
/* Hide native scrollbars */ /* Hide native scrollbars */
scrollbar-width: none; /* Firefox */ scrollbar-width: none; /* Firefox */