@@ -31,8 +31,8 @@ const Wrapper = styled.div<{$height: boolean; $showVerticalScrollbar:boolean}>`
31
31
background-color: #fff;
32
32
border: 1px solid #d7d9e0;
33
33
border-radius: 4px;
34
- overflow: scroll;
35
- height: ${ ( props ) => ( props . $height ? '100%' : '300px ' ) } ;
34
+ overflow-y : scroll;
35
+ height: ${ ( props ) => ( props . $height ? '100%' : '200px ' ) } ;
36
36
&::-webkit-scrollbar {
37
37
width: 16px;
38
38
display: ${ props => props . $showVerticalScrollbar && 'block !important' } ;
@@ -70,7 +70,7 @@ function fixOldDataSecond(oldData: any) {
70
70
const childrenMap = {
71
71
value : jsonValueExposingStateControl ( 'value' , defaultData ) ,
72
72
onEvent : ChangeEventHandlerControl ,
73
- autoHeight : AutoHeightControl ,
73
+ autoHeight : withDefault ( AutoHeightControl , 'auto' ) ,
74
74
showVerticalScrollbar :BoolControl ,
75
75
label : withDefault ( LabelControl , { position : 'column' } ) ,
76
76
style : styleControl ( JsonEditorStyle , 'style' ) ,
@@ -156,9 +156,9 @@ let JsonEditorTmpComp = (function () {
156
156
< Section name = { trans ( 'prop.height' ) } >
157
157
{ children . autoHeight . propertyView ( { label : trans ( 'prop.height' ) } ) }
158
158
</ Section >
159
- < Section name = { sectionNames . layout } >
159
+ { ! children . autoHeight . getView ( ) && < Section name = { sectionNames . layout } >
160
160
{ children . showVerticalScrollbar . propertyView ( { label :trans ( 'prop.showVerticalScrollbar' ) } ) }
161
- </ Section >
161
+ </ Section > }
162
162
{ ( useContext ( EditorContext ) . editorModeStatus === "layout" || useContext ( EditorContext ) . editorModeStatus === "both" ) && ( children . label . getPropertyView ( ) ) }
163
163
{ ( useContext ( EditorContext ) . editorModeStatus === "layout" || useContext ( EditorContext ) . editorModeStatus === "both" ) && (
164
164
< >
@@ -179,7 +179,7 @@ JsonEditorTmpComp = migrateOldData(JsonEditorTmpComp, fixOldDataSecond);
179
179
180
180
JsonEditorTmpComp = class extends JsonEditorTmpComp {
181
181
override autoHeight ( ) : boolean {
182
- return false ;
182
+ return this . children . autoHeight . getView ( ) ;
183
183
}
184
184
} ;
185
185
0 commit comments