Fixed an issue where textarea of the JSON Editor does not resize with dialog. Fixes #7656

This commit is contained in:
Yogesh Mahajan
2022-09-08 15:31:36 +05:30
committed by Akshay Joshi
parent 0c9c57e608
commit 603ce21d24
2 changed files with 8 additions and 0 deletions

View File

@@ -20,6 +20,13 @@ export default function JsonEditor({getEditor, value, options, className}) {
modes: ['code', 'form', 'tree','preview'],
};
useEffect(()=>{
const editorResizeObserver = new ResizeObserver(()=>{
editor.current.resize();
});
editorResizeObserver.observe(eleRef.current);
}, []);
useEffect(()=>{
/* Create the object only once on mount */
editor.current = new OrigJsonEditor(eleRef.current, {