mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-11-01 07:48:03 -06:00
Fixed an issue where json editor in result grid was crashing if null value is set in the json editor. #8907
This commit is contained in:
1 parent
3aad58751a
commit
ced002a6ad
1 file changed
+2
-1
@@ -416,6 +416,7 @@ export function JsonTextEditor({row, column, onRowChange, onClose}) {
|
||||
const [hasError, setHasError] = React.useState(false);
|
||||
|
||||
const onChange = React.useCallback((newVal)=>{
|
||||
newVal = newVal == '' ? null : newVal;
|
||||
setLocalVal(newVal);
|
||||
}, []);
|
||||
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} >
|
||||
<JsonEditor
|
||||
setJsonEditorSize={setJsonEditorSize}
|
||||
value={localVal}
|
||||
value={localVal??''}
|
||||
options={{
|
||||
onChange: onChange,
|
||||
onValidationError: (errors)=>{setHasError(Boolean(errors));}
|
||||
|
||||
Reference in new issue
Block a user