[Bug] Do not overwrite the content of JSONTextField while the user is editing such (#895)
* Do not overwrite the context of JSONTextField while the user is editing such * Style changes * Handle case where valid JSON could potentially be overwritten.
This commit is contained in:
committed by
Paulus Schoutsen
parent
83e34f3f95
commit
012e0981f2
@@ -32,6 +32,7 @@ export default class JSONTextArea extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps({ value }) {
|
componentWillReceiveProps({ value }) {
|
||||||
|
if (value === this.props.value) return;
|
||||||
this.setState({
|
this.setState({
|
||||||
value: JSON.stringify(value, null, 2),
|
value: JSON.stringify(value, null, 2),
|
||||||
isValid: true,
|
isValid: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user