mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
OverrideEditor: Use field config default value when adding a new override (#24347)
This commit is contained in:
parent
66b7398fb6
commit
75ce947267
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user