Skip to content

Commit 9b7f49b

Browse files
committed
scrollbar comp used
1 parent 774b2aa commit 9b7f49b

File tree

1 file changed

+12
-18
lines changed

1 file changed

+12
-18
lines changed

client/packages/lowcoder/src/comps/comps/jsonComp/jsonExplorerComp.tsx

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Section, sectionNames } from "lowcoder-design";
1+
import { ScrollBar, Section, sectionNames } from "lowcoder-design";
22
import { UICompBuilder, withDefault } from "../../generators";
33
import { NameConfigHidden, NameConfig, withExposingConfigs } from "../../generators/withExposing";
44
import ReactJson, { type ThemeKeys } from "react-json-view";
@@ -41,8 +41,6 @@ const bgColorMap = {
4141
const JsonExplorerContainer = styled.div<{
4242
$theme: keyof typeof bgColorMap;
4343
$animationStyle: AnimationStyleType;
44-
$height: boolean;
45-
$showVerticalScrollbar:boolean;
4644
}>`
4745
${(props) => props.$animationStyle}
4846
height: 100%;
@@ -51,10 +49,6 @@ const JsonExplorerContainer = styled.div<{
5149
border: 1px solid #d7d9e0;
5250
border-radius: 4px;
5351
padding: 10px;
54-
&::-webkit-scrollbar {
55-
width: 16px;
56-
display: ${props=>props.$showVerticalScrollbar&&'block !important'};
57-
}
5852
`;
5953

6054
let JsonExplorerTmpComp = (function () {
@@ -72,21 +66,21 @@ let JsonExplorerTmpComp = (function () {
7266

7367
return (
7468
<JsonExplorerContainer
75-
$height={props.autoHeight}
7669
$theme={props.theme as keyof typeof bgColorMap}
7770
$animationStyle={props.animationStyle}
78-
$showVerticalScrollbar={props.showVerticalScrollbar}
7971
>
80-
<ReactJson
81-
name={false}
82-
src={props.value}
83-
theme={props.theme as ThemeKeys}
84-
collapsed={!props.expandToggle}
85-
displayDataTypes={false}
86-
indentWidth={props.indent}
87-
/>
72+
<ScrollBar hideScrollbar={!props.showVerticalScrollbar}>
73+
<ReactJson
74+
name={false}
75+
src={props.value}
76+
theme={props.theme as ThemeKeys}
77+
collapsed={!props.expandToggle}
78+
displayDataTypes={false}
79+
indentWidth={props.indent}
80+
/>
81+
</ScrollBar>
8882
</JsonExplorerContainer>
89-
)
83+
);
9084
})
9185
.setPropertyViewFn((children) => {
9286
return (

0 commit comments

Comments
 (0)