3.5.9
Updated pet calcs to be more accurate Fixed some layout issues Updated profile popup
This commit is contained in:
@@ -630,7 +630,7 @@ export function useAppState() {
|
||||
tableCanScrollRight,
|
||||
handleBodyScroll,
|
||||
} = useTableScroll({
|
||||
headTableRef, bodyTableRef, bodyScrollRef, headTrackRef,
|
||||
headTableRef, bodyTableRef, bodyScrollRef, headTrackRef, tableWrapRef,
|
||||
forecast, visibleCols, selectedDay, skinType, vehicleType,
|
||||
indoorMode, indoorManaged, showDecimals, showUnits,
|
||||
});
|
||||
|
||||
@@ -29,6 +29,7 @@ export function useTableScroll({
|
||||
bodyTableRef,
|
||||
bodyScrollRef,
|
||||
headTrackRef,
|
||||
tableWrapRef,
|
||||
forecast,
|
||||
visibleCols,
|
||||
selectedDay,
|
||||
@@ -111,6 +112,15 @@ export function useTableScroll({
|
||||
const body = bodyScrollRef.current;
|
||||
if (!track || !body) return;
|
||||
track.style.transform = `translate3d(${-body.scrollLeft}px, 0, 0)`;
|
||||
// The Hour column's header cells (one per thead row) need to stay
|
||||
// pinned to the left edge even though the track they live in is
|
||||
// being shifted above - cancel that shift with an equal-and-opposite
|
||||
// translate so they hold still while the rest of the header scrolls.
|
||||
const headTable = headTableRef.current;
|
||||
if (headTable) {
|
||||
const pinnedCells = headTable.querySelectorAll('thead th:first-child');
|
||||
pinnedCells.forEach(c => { c.style.transform = `translate3d(${body.scrollLeft}px, 0, 0)`; });
|
||||
}
|
||||
updateTableScrollIndicators();
|
||||
};
|
||||
|
||||
@@ -198,6 +208,12 @@ export function useTableScroll({
|
||||
// column N in the body, no drift as you scroll right.
|
||||
headTable.style.width = `${totalWidth}px`;
|
||||
bodyTable.style.width = `${totalWidth}px`;
|
||||
// Expose the pinned Hour column's width as a CSS var so the left
|
||||
// scroll-fade indicator can start after it, over the first column
|
||||
// that actually scrolls, rather than over the pinned column itself.
|
||||
if (tableWrapRef && tableWrapRef.current) {
|
||||
tableWrapRef.current.style.setProperty('--hour-col-w', `${finalW[0]}px`);
|
||||
}
|
||||
// Re-apply current horizontal offset so column alignment survives.
|
||||
handleBodyScroll();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user