Skip to content

Commit 6fcb42a

Browse files
authored
feat(AnalyticalTable): always show scrollbars if needed (#706)
closes #698
1 parent 5e21750 commit 6fcb42a

File tree

5 files changed

+4218
-3999
lines changed

5 files changed

+4218
-3999
lines changed

packages/main/src/components/AnalyticalTable/AnayticalTable.jss.ts

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,27 @@ const styles = {
1212
minHeight: '3rem',
1313
fontFamily: ThemingParameters.sapFontFamily,
1414
fontSize: ThemingParameters.sapFontSize,
15-
fontWeight: 'normal'
15+
fontWeight: 'normal',
16+
backgroundColor: ThemingParameters.sapList_Background
1617
},
1718
tableHeaderRow: {
1819
height: CssSizeVariables.sapWcrAnalyticalTableRowHeight,
1920
display: 'inline-flex'
2021
},
21-
th: {
22+
tableHeaderBackgroundElement: {
23+
boxSizing: 'border-box',
24+
position: 'absolute',
25+
left: 0,
26+
right: 0,
27+
height: CssSizeVariables.sapWcrAnalyticalTableRowHeight,
2228
backgroundColor: ThemingParameters.sapList_HeaderBackground,
29+
borderTop: `1px solid ${ThemingParameters.sapList_BorderColor}`,
30+
borderBottom: `1px solid ${ThemingParameters.sapList_BorderColor}`
31+
},
32+
th: {
2333
height: CssSizeVariables.sapWcrAnalyticalTableRowHeight,
2434
color: ThemingParameters.sapList_HeaderTextColor,
35+
backgroundColor: ThemingParameters.sapList_HeaderBackground,
2536
borderTop: `1px solid ${ThemingParameters.sapList_BorderColor}`,
2637
borderBottom: `1px solid ${ThemingParameters.sapList_BorderColor}`,
2738
borderRight: `1px solid ${ThemingParameters.sapList_BorderColor}`,
@@ -39,9 +50,13 @@ const styles = {
3950
},
4051
tbody: {
4152
position: 'relative',
42-
backgroundColor: ThemingParameters.sapList_Background,
4353
overflowX: 'hidden',
44-
overflowY: 'auto'
54+
overflowY: 'auto',
55+
scrollBarWidth: 'none !important',
56+
'&::-webkit-scrollbar': {
57+
width: 0,
58+
height: 0
59+
}
4560
},
4661
alternateRowColor: {
4762
backgroundColor: ThemingParameters.sapList_AlternatingBackground

packages/main/src/components/AnalyticalTable/TableBody/VirtualTableBodyContainer.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { StyleClassHelper } from '@ui5/webcomponents-react-base/lib/StyleClassHelper';
22
import React, { useCallback, useEffect, useRef, useState } from 'react';
3-
import { GlobalStyleClasses } from '@ui5/webcomponents-react/lib/GlobalStyleClasses';
43

54
export const VirtualTableBodyContainer = (props) => {
65
const {
@@ -13,7 +12,8 @@ export const VirtualTableBodyContainer = (props) => {
1312
infiniteScrollThreshold,
1413
onLoadMore,
1514
rows,
16-
internalRowHeight
15+
internalRowHeight,
16+
handleExternalScroll
1717
} = props;
1818
const [isMounted, setIsMounted] = useState(false);
1919

@@ -23,13 +23,14 @@ export const VirtualTableBodyContainer = (props) => {
2323
}
2424
}, [parentRef.current]);
2525

26-
const classNames = StyleClassHelper.of(classes.tbody, GlobalStyleClasses.sapScrollBar).className;
26+
const classNames = StyleClassHelper.of(classes.tbody).className;
2727

2828
const lastScrollTop = useRef(0);
2929
const firedInfiniteLoadEvents = useRef(new Set());
3030

3131
const onScroll = useCallback(
3232
(event) => {
33+
handleExternalScroll();
3334
const scrollOffset = event.target.scrollTop;
3435
const isScrollingDown = lastScrollTop.current < scrollOffset;
3536
if (isScrollingDown && infiniteScroll) {
@@ -54,7 +55,8 @@ export const VirtualTableBodyContainer = (props) => {
5455
rows.length,
5556
internalRowHeight,
5657
firedInfiniteLoadEvents,
57-
lastScrollTop
58+
lastScrollTop,
59+
handleExternalScroll
5860
]
5961
);
6062

0 commit comments

Comments
 (0)