-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When scrolling horizontally, table header goes behind the first frozen column #6304
Comments
To fix the issue where the table header goes behind the first frozen column when scrolling horizontally, follow these steps:
const StyledTable = styled.table`
border-radius: ${({ theme }) => theme.border.radius.sm};
border-spacing: 0;
margin-right: ${({ theme }) => theme.table.horizontalCellMargin};
table-layout: fixed;
width: calc(100% - ${({ theme }) => theme.table.horizontalCellMargin} * 2);
thead {
position: sticky;
top: 0;
z-index: 2; // Ensure header is above other elements
}
`;
const StyledTd = styled.td<{
zIndex?: number;
backgroundColor: string;
borderColor: string;
isDragging?: boolean;
fontColor: string;
sticky?: boolean;
freezeFirstColumns?: boolean;
left?: number;
hasRightBorder?: boolean;
hasBottomBorder?: boolean;
}>`
// existing styles
${({ sticky }) =>
sticky
? `
position: sticky;
left: 0;
z-index: 3; // Ensure frozen column is above other elements
`
: ''}
`;
useEffect(() => {
const element = recordTableRef.current;
if (element) {
if (scrollLeft > 0) {
element.classList.add('freeze-first-columns-shadow');
} else {
element.classList.remove('freeze-first-columns-shadow');
}
}
}, [scrollLeft, recordTableRef]); These changes should ensure that the table header remains above the first frozen column when scrolling horizontally. References/packages/twenty-front/src/modules/object-record/record-table/components/RecordTable.tsx
|
https://github.com/user-attachments/assets/5f8741ad-bdab-4ef3-8741-dacbd2381ea3 fix: When scrolling horizontally, table header goes behind the first frozen column #6304
FIxed by #6315 |
Bug Description
When scrolling horizontally, table header goes behind the first frozen column and becomes visible again when we scroll too much.
See video below
Screen.Recording.2024-07-17.at.11.16.34.mov
Expected behavior
I should not see table header of other columns
The text was updated successfully, but these errors were encountered: