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({
184184 const validateAndSetLocalValue = newValue => {
185185 let isValid = false ;
186186 try {
187- JSON . parse ( sanitizeForParse ( value ) ) ;
187+ JSON . parse ( sanitizeForParse ( newValue ) ) ;
188188 isValid = true ;
189189 } catch ( error ) { }
190190
@@ -203,7 +203,7 @@ function Row({
203203 } ;
204204
205205 const submitValueChange = ( ) => {
206- if ( isValueValid ) {
206+ if ( isAttributeValid && isValueValid ) {
207207 const parsedLocalValue = JSON . parse ( sanitizeForParse ( localValue ) ) ;
208208 if ( value !== parsedLocalValue ) {
209209 changeValue ( attribute , parsedLocalValue ) ;
@@ -212,8 +212,10 @@ function Row({
212212 } ;
213213
214214 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+ }
217219 }
218220 } ;
219221
You can’t perform that action at this time.
0 commit comments