File tree Expand file tree Collapse file tree 2 files changed +2
-0
lines changed Expand file tree Collapse file tree 2 files changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -1238,6 +1238,7 @@ This component is heavily inspired by [react-json-view](https://github.com/mac-s
12381238
12391239## Changelog
12401240
1241+ - **1.28.2**: When switching data type, only keep editing if new type is primitive ([#216](https://github.com/CarlosNZ/json-edit-react/issues/216))
12411242- **1.28.1**: Fix left padding of root node when value is primitive ([#214](https://github.com/CarlosNZ/json-edit-react/issues/214))
12421243- **1.28.0**:
12431244 - (Optional) tooltips for icons ([#211](https://github.com/CarlosNZ/json-edit-react/pull/211))
Original file line number Diff line number Diff line change @@ -200,6 +200,7 @@ export const ValueNodeWrapper: React.FC<ValueNodeProps> = (props) => {
200200 // that won't match the custom node condition any more
201201 customNodeData ?. CustomNode ? translate ( 'DEFAULT_STRING' , nodeData ) : undefined
202202 )
203+ if ( ! [ 'string' , 'number' , 'boolean' ] . includes ( type ) ) setCurrentlyEditingElement ( null )
203204 onEdit ( newValue , path ) . then ( ( error ) => {
204205 if ( error ) {
205206 onError ( { code : 'UPDATE_ERROR' , message : error } , newValue as JsonData )
You can’t perform that action at this time.
0 commit comments