File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
packages/react-devtools-shared/src/devtools/views/Components/NativeStyleEditor Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -184,7 +184,7 @@ function Row({
184
184
const validateAndSetLocalValue = newValue => {
185
185
let isValid = false ;
186
186
try {
187
- JSON . parse ( sanitizeForParse ( value ) ) ;
187
+ JSON . parse ( sanitizeForParse ( newValue ) ) ;
188
188
isValid = true ;
189
189
} catch ( error ) { }
190
190
@@ -203,7 +203,7 @@ function Row({
203
203
} ;
204
204
205
205
const submitValueChange = ( ) => {
206
- if ( isValueValid ) {
206
+ if ( isAttributeValid && isValueValid ) {
207
207
const parsedLocalValue = JSON . parse ( sanitizeForParse ( localValue ) ) ;
208
208
if ( value !== parsedLocalValue ) {
209
209
changeValue ( attribute , parsedLocalValue ) ;
@@ -212,8 +212,10 @@ function Row({
212
212
} ;
213
213
214
214
const submitAttributeChange = ( ) => {
215
- if ( isAttributeValid && attribute !== localAttribute ) {
216
- changeAttribute ( attribute , localAttribute , value ) ;
215
+ if ( isAttributeValid && isValueValid ) {
216
+ if ( attribute !== localAttribute ) {
217
+ changeAttribute ( attribute , localAttribute , value ) ;
218
+ }
217
219
}
218
220
} ;
219
221
You can’t perform that action at this time.
0 commit comments