GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fixed a StyleEditor variable resolution regression · react/react@7153dd5

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/react-devtools-shared/src/devtools/views/Components/NativeStyleEditor
    • StyleEditor.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/react-devtools-shared/src/devtools/views/Components/NativeStyleEditor/StyleEditor.js‎

Copy file name to clipboardExpand all lines: packages/react-devtools-shared/src/devtools/views/Components/NativeStyleEditor/StyleEditor.js
+6-4Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.