Fixed an issue where json editor in result grid was crashing if null value is set in the json editor. #8907
parent
3aad58751a
commit
ced002a6ad
|
|
@ -416,6 +416,7 @@ export function JsonTextEditor({row, column, onRowChange, onClose}) {
|
||||||
const [hasError, setHasError] = React.useState(false);
|
const [hasError, setHasError] = React.useState(false);
|
||||||
|
|
||||||
const onChange = React.useCallback((newVal)=>{
|
const onChange = React.useCallback((newVal)=>{
|
||||||
|
newVal = newVal == '' ? null : newVal;
|
||||||
setLocalVal(newVal);
|
setLocalVal(newVal);
|
||||||
}, []);
|
}, []);
|
||||||
const onOK = ()=>{
|
const onOK = ()=>{
|
||||||
|
|
@ -453,7 +454,7 @@ export function JsonTextEditor({row, column, onRowChange, onClose}) {
|
||||||
className='Editors-jsonEditor' data-label="pg-editor" resizeKey={'json'} defaultSize={{height:'500px', width:'600px'}} onKeyDown={suppressEnterKey} >
|
className='Editors-jsonEditor' data-label="pg-editor" resizeKey={'json'} defaultSize={{height:'500px', width:'600px'}} onKeyDown={suppressEnterKey} >
|
||||||
<JsonEditor
|
<JsonEditor
|
||||||
setJsonEditorSize={setJsonEditorSize}
|
setJsonEditorSize={setJsonEditorSize}
|
||||||
value={localVal}
|
value={localVal??''}
|
||||||
options={{
|
options={{
|
||||||
onChange: onChange,
|
onChange: onChange,
|
||||||
onValidationError: (errors)=>{setHasError(Boolean(errors));}
|
onValidationError: (errors)=>{setHasError(Boolean(errors));}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue