Skip to content

Commit

Permalink
fix: use null instead of undefined when unset attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
maitrungduc1410 committed Jun 6, 2023
1 parent 56635e2 commit 1711d1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pages/panel/components/InspectedElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export default function InspectedElement({ selectedNode }: IProps) {
updateAttr(
item.name,
isNaN(e.target.valueAsNumber)
? ""
? null // JSON.stringify will not preserve undefined, so we have to use null here
: e.target.valueAsNumber
)
}
Expand Down

0 comments on commit 1711d1f

Please sign in to comment.