Skip to content

Commit da731f2

Browse files
committed
scroll fixed
1 parent a21a575 commit da731f2

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ const Wrapper = styled.div<{$height: boolean; $showVerticalScrollbar:boolean}>`
3131
background-color: #fff;
3232
border: 1px solid #d7d9e0;
3333
border-radius: 4px;
34-
overflow: scroll;
35-
height: ${(props) => (props.$height ? '100%' : '300px')};
34+
overflow-y: scroll;
35+
height: ${(props) => (props.$height ? '100%' : '200px')};
3636
&::-webkit-scrollbar {
3737
width: 16px;
3838
display: ${props=>props.$showVerticalScrollbar&&'block !important'};
@@ -70,7 +70,7 @@ function fixOldDataSecond(oldData: any) {
7070
const childrenMap = {
7171
value: jsonValueExposingStateControl('value', defaultData),
7272
onEvent: ChangeEventHandlerControl,
73-
autoHeight: AutoHeightControl,
73+
autoHeight: withDefault(AutoHeightControl,'auto'),
7474
showVerticalScrollbar:BoolControl,
7575
label: withDefault(LabelControl, {position: 'column'}),
7676
style: styleControl(JsonEditorStyle, 'style'),
@@ -156,9 +156,9 @@ let JsonEditorTmpComp = (function () {
156156
<Section name={trans('prop.height')}>
157157
{children.autoHeight.propertyView({ label: trans('prop.height') })}
158158
</Section>
159-
<Section name={sectionNames.layout}>
159+
{!children.autoHeight.getView()&&<Section name={sectionNames.layout}>
160160
{children.showVerticalScrollbar.propertyView({label:trans('prop.showVerticalScrollbar')})}
161-
</Section>
161+
</Section>}
162162
{(useContext(EditorContext).editorModeStatus === "layout" || useContext(EditorContext).editorModeStatus === "both") && ( children.label.getPropertyView() )}
163163
{(useContext(EditorContext).editorModeStatus === "layout" || useContext(EditorContext).editorModeStatus === "both") && (
164164
<>
@@ -179,7 +179,7 @@ JsonEditorTmpComp = migrateOldData(JsonEditorTmpComp, fixOldDataSecond);
179179

180180
JsonEditorTmpComp = class extends JsonEditorTmpComp {
181181
override autoHeight(): boolean {
182-
return false;
182+
return this.children.autoHeight.getView();
183183
}
184184
};
185185

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const JsonExplorerContainer = styled.div<{
6060
let JsonExplorerTmpComp = (function () {
6161
const childrenMap = {
6262
value: withDefault(ArrayOrJSONObjectControl, JSON.stringify(defaultData, null, 2)),
63-
autoHeight: AutoHeightControl,
63+
autoHeight: withDefault(AutoHeightControl, 'auto'),
6464
showVerticalScrollbar:BoolControl,
6565
indent: withDefault(NumberControl, 4),
6666
expandToggle: BoolControl.DEFAULT_TRUE,
@@ -110,11 +110,11 @@ let JsonExplorerTmpComp = (function () {
110110
<Section name={trans('prop.height')}>
111111
{children.autoHeight.propertyView({label: trans('prop.height')})}
112112
</Section>
113-
<Section name={sectionNames.layout}>
113+
{!children.autoHeight.getView()&&<Section name={sectionNames.layout}>
114114
{children.showVerticalScrollbar.propertyView({
115115
label: trans('prop.showVerticalScrollbar'),
116116
})}
117-
</Section>
117+
</Section>}
118118
{(useContext(EditorContext).editorModeStatus === 'layout' ||
119119
useContext(EditorContext).editorModeStatus === 'both') && (
120120
<>
@@ -136,7 +136,7 @@ let JsonExplorerTmpComp = (function () {
136136

137137
JsonExplorerTmpComp = class extends JsonExplorerTmpComp {
138138
override autoHeight(): boolean {
139-
return false;
139+
return this.children.autoHeight.getView();
140140
}
141141
};
142142

0 commit comments

Comments
 (0)