Skip to content

Commit ec73757

Browse files
committed
vertical and horizontal scrollbar
1 parent 8fd052a commit ec73757

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

client/packages/lowcoder/src/comps/comps/listViewComp/listView.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ export function ListView(props: Props) {
186186
[children.noOfRows]
187187
);
188188
const autoHeight = useMemo(() => children.autoHeight.getView(), [children.autoHeight]);
189-
const scrollbars = useMemo(() => children.scrollbars.getView(), [children.scrollbars]);
189+
const showHorizontalScrollbar = useMemo(() => children.showHorizontalScrollbar.getView(), [children.showHorizontalScrollbar]);
190+
const showVerticalScrollbar = useMemo(() => children.showVerticalScrollbar.getView(), [children.showVerticalScrollbar]);
190191
const horizontal = useMemo(() => children.horizontal.getView(), [children.horizontal]);
191192
const minHorizontalWidth = useMemo(() => children.minHorizontalWidth.getView(), [children.minHorizontalWidth]);
192193
const noOfColumns = useMemo(
@@ -286,7 +287,7 @@ export function ListView(props: Props) {
286287
<BackgroundColorContext.Provider value={style.background}>
287288
<ListViewWrapper $style={style} $paddingWidth={paddingWidth} $animationStyle={animationStyle}>
288289
<BodyWrapper ref={ref} $autoHeight={autoHeight}>
289-
<ScrollBar style={{ height: autoHeight ? "auto" : "100%", margin: "0px", padding: "0px" }} hideScrollbar={!scrollbars} overflow={autoHeight?'hidden':'scroll'}>
290+
<ScrollBar style={{ height: autoHeight ? "auto" : "100%", margin: "0px", padding: "0px" }} hideScrollbar={horizontal?!showHorizontalScrollbar:!showVerticalScrollbar} overflow={autoHeight?horizontal?'scroll':'hidden':'scroll'}>
290291
<ReactResizeDetector
291292
onResize={(width?: number, height?: number) => {
292293
if (height) setListHeight(height);

client/packages/lowcoder/src/comps/comps/listViewComp/listViewComp.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ const childrenMap = {
4949
heightUnitOfRow: withDefault(NumberControl, 1),
5050
container: ContextContainerComp,
5151
autoHeight: AutoHeightControl,
52-
scrollbars: withDefault(BoolControl, false),
52+
showVerticalScrollbar: withDefault(BoolControl, false),
53+
showHorizontalScrollbar: withDefault(BoolControl, false),
5354
showBorder: BoolControl,
5455
pagination: withDefault(PaginationControl, { pageSize: "6" }),
5556
style: styleControl(ListViewStyle, 'style'),

client/packages/lowcoder/src/comps/comps/listViewComp/listViewPropertyView.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,14 @@ export function listPropertyView(compType: ListCompType) {
6262
{(useContext(EditorContext).editorModeStatus === "layout" || useContext(EditorContext).editorModeStatus === "both") && (
6363
<><Section name={sectionNames.layout}>
6464
{children.autoHeight.getPropertyView()}
65+
{(!children.autoHeight.getView()) &&
66+
children.showVerticalScrollbar.propertyView({
67+
label: trans("prop.showVerticalScrollbar"),
68+
}
69+
)}
6570
{(!children.autoHeight.getView() || children.horizontal.getView()) &&
66-
children.scrollbars.propertyView({
67-
label: trans("prop.scrollbar"),
71+
children.showHorizontalScrollbar.propertyView({
72+
label: trans("prop.showHorizontalScrollbar"),
6873
}
6974
)}
7075
{children.horizontal.propertyView({

0 commit comments

Comments
 (0)