Skip to content

Commit 11ed271

Browse files
committed
fixed in a hacky way
1 parent cf967bc commit 11ed271

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

packages/gui/src/components/schemas/theme.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ export function themeScale(path: string): DataTypeSchema<ThemeValue> {
3434
options={range(0, numOptions).map((x) => x.toString())}
3535
/>
3636
)
37-
// return null
3837
},
3938
// TODO function version of defaultValue, pass in theme
4039
defaultValue: { type: 'theme', path, index: 0 },
@@ -61,21 +60,20 @@ export function themeRecord(path: string): DataTypeSchema<ThemeNamedValue> {
6160
},
6261
inlineInput(props) {
6362
const theme = useTheme()
64-
const options = get(theme, path)
63+
const options = Object.keys(get(theme, path))
6564
return (
6665
<SelectInput
6766
label=""
68-
value={`${props.value.key}`}
67+
value={props.value.key || options[0]}
6968
onChange={(value) =>
7069
props.onChange({
7170
...props.value,
7271
key: value,
7372
})
7473
}
75-
options={Object.keys(options)}
74+
options={options}
7675
/>
7776
)
78-
// return null
7977
},
8078
// TODO function version of defaultValue, pass in theme
8179
defaultValue: { type: 'theme', path, key: '' },

0 commit comments

Comments
 (0)