Skip to content

Commit 2908cba

Browse files
committed
Make sure default value is passed to base schema
1 parent 2ae9a0e commit 2908cba

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.changeset/cold-ties-fly.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@compai/css-gui': patch
3+
---
4+
5+
Make sure default value is passed to base schema

packages/gui/src/data/properties.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,18 +119,17 @@ function normalizeSchema(propertyData: PropertyData): DataTypeSchema<any> {
119119
stringify: (value) => String(value),
120120
}
121121
} else {
122-
const { defaultValue, ...basePropertyData } = propertyData
123122
// TODO: Figure out how to make this use Ranges rather than UnitRanges
124123
// so there's proper support for `range: 'nonnegative'`
125124
// @ts-ignore
126-
let schema = primitiveMap[input](basePropertyData) as any
125+
let schema = primitiveMap[input](propertyData) as any
127126
return joinSchemas(
128127
compact([
129128
schema,
130129
keywords && keyword(keywords),
131130
themeProperty && themeSchema(themeProperty),
132131
]),
133-
{ defaultValue }
132+
{ defaultValue: propertyData.defaultValue }
134133
)
135134
}
136135
}

0 commit comments

Comments
 (0)