Skip to content

Commit dc6c5b9

Browse files
committed
fix scolling customization
1 parent 19692fd commit dc6c5b9

File tree

1 file changed

+15
-22
lines changed

1 file changed

+15
-22
lines changed

client/packages/lowcoder/src/comps/comps/tableLiteComp/parts/TableContainer.tsx

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,21 @@ const MainContainer = styled.div<{
2929
visibility: hidden !important;
3030
}
3131
`}
32+
33+
/* Ant Table virtualization scrollbar - match SimpleBar colors */
34+
.ant-table-tbody-virtual-scrollbar-thumb {
35+
background: rgba(0,0,0,0.35) !important;
36+
border-radius: 6px;
37+
transition: background .2s ease;
38+
}
39+
40+
.ant-table-tbody-virtual-scrollbar-horizontal {
41+
display: ${(props) => (props.$showHorizontalScrollbar) ? 'block' : 'none'} !important;
42+
}
43+
44+
.ant-table-tbody-virtual-scrollbar-vertical {
45+
display: ${(props) => (props.$showVerticalScrollbar) ? 'block' : 'none'} !important;
46+
}
3247
3348
`;
3449

@@ -61,13 +76,6 @@ const TableSection = styled.div<{
6176
}>`
6277
min-height: 0;
6378
min-width: 0;
64-
65-
/* Ant Table virtualization scrollbar - match SimpleBar colors */
66-
.ant-table-tbody-virtual-scrollbar-thumb {
67-
background: rgba(0,0,0,0.35) !important;
68-
border-radius: 6px;
69-
transition: background .2s ease;
70-
}
7179
`;
7280

7381
const SimpleBarWrapper = styled(SimpleBar)`
@@ -120,7 +128,6 @@ export const TableContainer: React.FC<TableContainerProps> = ({
120128
showHorizontalScrollbar,
121129
virtual
122130
}) => {
123-
const hideScrollbar = !showHorizontalScrollbar && !showVerticalScrollbar;
124131

125132
React.useEffect(() => {
126133
// eslint-disable-next-line no-console
@@ -141,19 +148,6 @@ export const TableContainer: React.FC<TableContainerProps> = ({
141148
)}
142149

143150
<TableSection $mode={mode}>
144-
{hideScrollbar ? (
145-
/* No scrollbars - render without SimpleBar */
146-
<>
147-
{!stickyToolbar && toolbarPosition === 'above' && showToolbar && (
148-
<DefaultToolbar>{toolbar}</DefaultToolbar>
149-
)}
150-
{children}
151-
{!stickyToolbar && toolbarPosition === 'below' && showToolbar && (
152-
<DefaultToolbar>{toolbar}</DefaultToolbar>
153-
)}
154-
</>
155-
) : (
156-
/* Scrollbars enabled - use SimpleBar */
157151
<SimpleBarWrapper className="simplebar-wrapper" autoHide={true}>
158152
{!stickyToolbar && toolbarPosition === 'above' && showToolbar && (
159153
<DefaultToolbar>{toolbar}</DefaultToolbar>
@@ -163,7 +157,6 @@ export const TableContainer: React.FC<TableContainerProps> = ({
163157
<DefaultToolbar>{toolbar}</DefaultToolbar>
164158
)}
165159
</SimpleBarWrapper>
166-
)}
167160
</TableSection>
168161

169162
{/* Sticky below toolbar - always visible */}

0 commit comments

Comments
 (0)