@@ -107,9 +107,16 @@ let JsonEditorTmpComp = (function () {
107
107
doc : JSON . stringify ( props . value . value , null , 2 ) ,
108
108
extensions,
109
109
} ) ;
110
- view . current = new EditorView ( { state, parent : wrapperRef . current } ) ;
110
+ view . current = new EditorView ( { state, parent : wrapperRef . current } ) ;
111
111
}
112
- } , [ wrapperRef . current ] ) ;
112
+ if ( wrapperRef . current && ( props . showVerticalScrollbar || ! props . showVerticalScrollbar ) ) {
113
+ const state = EditorState . create ( {
114
+ doc : JSON . stringify ( props . value . value , null , 2 ) ,
115
+ extensions,
116
+ } ) ;
117
+ view . current = new EditorView ( { state, parent : wrapperRef . current } ) ;
118
+ }
119
+ } , [ wrapperRef . current , props . showVerticalScrollbar ] ) ;
113
120
114
121
if ( wrapperRef . current && view . current && ! editContent . current ) {
115
122
const state = EditorState . create ( {
@@ -125,8 +132,6 @@ let JsonEditorTmpComp = (function () {
125
132
style : props . style ,
126
133
animationStyle : props . animationStyle ,
127
134
children : (
128
-
129
-
130
135
< ScrollBar hideScrollbar = { ! props . showVerticalScrollbar } >
131
136
< Wrapper
132
137
ref = { wrapperRef }
@@ -135,7 +140,6 @@ let JsonEditorTmpComp = (function () {
135
140
$showVerticalScrollbar = { props . showVerticalScrollbar }
136
141
/>
137
142
</ ScrollBar >
138
-
139
143
) ,
140
144
} ) ;
141
145
} )
0 commit comments