Commit 75ce9472 by Torkel Ödegaard Committed by GitHub

OverrideEditor: Use field config default value when adding a new override (#24347)

parent 66b7398f
......@@ -82,14 +82,18 @@ export const OverrideEditor: React.FC<OverrideEditorProps> = ({
const onDynamicConfigValueAdd = useCallback(
(id: string) => {
const registryItem = registry.get(id);
const propertyConfig: DynamicConfigValue = {
id,
value: registryItem.defaultValue,
};
if (override.properties) {
override.properties.push(propertyConfig);
} else {
override.properties = [propertyConfig];
}
onChange(override);
},
[override, onChange]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment