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
5 changes: 1 addition & 4 deletions src/table/use-sticky-header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ export const useStickyHeader = (
}, [theadRef, secondaryTheadRef, secondaryTableRef, tableWrapperRef, tableRef]);
useLayoutEffect(() => {
syncColumnHeaderWidths();
// Content is not going to be layed out until the next frame in angular,
// so we need to sync the column headers again.
setTimeout(() => syncColumnHeaderWidths(), 0);
const secondaryTable = secondaryTableRef.current;
const primaryTable = tableWrapperRef.current;
return () => {
Expand All @@ -60,7 +57,7 @@ export const useStickyHeader = (
primaryTable.style.marginTop = '';
}
};
});
}, [secondaryTableRef, tableWrapperRef, syncColumnHeaderWidths]);
useResizeObserver(theadRef, syncColumnHeaderWidths);
const scrollToTop = () => {
if (!isMobile && theadRef.current && secondaryTheadRef.current && tableWrapperRef.current) {
Expand Down