Skip to content

Commit 0a7dfb8

Browse files
committed
responsive layout edited
1 parent 3de9006 commit 0a7dfb8

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { sameTypeMap, UICompBuilder, withDefault } from "comps/generators";
1818
import { addMapChildAction } from "comps/generators/sameTypeMap";
1919
import { NameConfigHidden, withExposingConfigs } from "comps/generators/withExposing";
2020
import { NameGenerator } from "comps/utils";
21-
import { ScrollBar, Section, controlItem, sectionNames } from "lowcoder-design";
21+
import { Section, controlItem, sectionNames } from "lowcoder-design";
2222
import { HintPlaceHolder } from "lowcoder-design";
2323
import _ from "lodash";
2424
import React, { useEffect } from "react";
@@ -47,6 +47,7 @@ import SliderControl from "@lowcoder-ee/comps/controls/sliderControl";
4747
const RowWrapper = styled(Row)<{
4848
$style: ResponsiveLayoutRowStyleType;
4949
$animationStyle: AnimationStyleType;
50+
$showScrollbar:boolean
5051
}>`
5152
${(props) => props.$animationStyle}
5253
height: 100%;
@@ -56,8 +57,12 @@ const RowWrapper = styled(Row)<{
5657
border-style: ${(props) => props.$style?.borderStyle};
5758
padding: ${(props) => props.$style.padding};
5859
background-color: ${(props) => props.$style.background};
59-
overflow-x: auto;
6060
rotate: ${props=> props.$style.rotation}
61+
overflow: ${(props) => (props.$showScrollbar ? 'auto' : 'hidden')};
62+
::-webkit-scrollbar {
63+
display: ${(props) => (props.$showScrollbar ? 'block' : 'none')};
64+
}
65+
6166
`;
6267

6368
const ColWrapper = styled(Col)<{
@@ -147,10 +152,10 @@ const ResponsiveLayout = (props: ResponsiveLayoutProps) => {
147152
<BackgroundColorContext.Provider value={props.style.background}>
148153
<DisabledContext.Provider value={props.disabled}>
149154
<div style={{padding: style.margin, height: '100%'}}>
150-
<ScrollBar style={{ height: autoHeight ? "auto" : "100%", margin: "0px", padding: "0px" }} hideScrollbar={!mainScrollbar}>
151155
<RowWrapper
152156
$style={style}
153157
$animationStyle={animationStyle}
158+
$showScrollbar={mainScrollbar}
154159
wrap={rowBreak}
155160
gutter={[horizontalSpacing, verticalSpacing]}
156161
>
@@ -185,7 +190,6 @@ const ResponsiveLayout = (props: ResponsiveLayoutProps) => {
185190
})
186191
}
187192
</RowWrapper>
188-
</ScrollBar>
189193
</div>
190194
</DisabledContext.Provider>
191195
</BackgroundColorContext.Provider>

0 commit comments

Comments
 (0)