Skip to content

Json components height #1091

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Aug 8, 2024
Prev Previous commit
Next Next commit
editor issue fixed
  • Loading branch information
MenamAfzal committed Aug 7, 2024
commit 002c5adceed19e3756e8f2c091c9215fdad20c47
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,16 @@ let JsonEditorTmpComp = (function () {
doc: JSON.stringify(props.value.value, null, 2),
extensions,
});
view.current = new EditorView({ state, parent: wrapperRef.current });
view.current = new EditorView({state, parent: wrapperRef.current});
}
}, [wrapperRef.current]);
if (wrapperRef.current&&(props.showVerticalScrollbar||!props.showVerticalScrollbar)) {
const state = EditorState.create({
doc: JSON.stringify(props.value.value, null, 2),
extensions,
});
view.current = new EditorView({state, parent: wrapperRef.current});
}
}, [wrapperRef.current, props.showVerticalScrollbar]);

if (wrapperRef.current && view.current && !editContent.current) {
const state = EditorState.create({
Expand All @@ -125,8 +132,6 @@ let JsonEditorTmpComp = (function () {
style: props.style,
animationStyle: props.animationStyle,
children: (


<ScrollBar hideScrollbar={!props.showVerticalScrollbar}>
<Wrapper
ref={wrapperRef}
Expand All @@ -135,7 +140,6 @@ let JsonEditorTmpComp = (function () {
$showVerticalScrollbar={props.showVerticalScrollbar}
/>
</ScrollBar>

),
});
})
Expand Down
Loading