Commit 0870ccea by Torkel Ödegaard Committed by GitHub

NewPanelEdit: Fixed error with custom override properties (#23055)

parent 0ed78068
......@@ -204,8 +204,8 @@ function setDynamicConfigValue(config: FieldConfig, value: DynamicConfigValue, c
const remove = val === undefined || val === null;
if (remove) {
if (value.custom) {
delete (config?.custom as any)[value.prop];
if (value.custom && config.custom) {
delete config.custom[value.prop];
} else {
delete (config as any)[value.prop];
}
......
......@@ -108,6 +108,33 @@ export const basicSelectPlainValue = () => {
/**
* Uses plain values instead of SelectableValue<T>
*/
export const SelectWithOptionDescriptions = () => {
// TODO this is not working with new Select
const [value, setValue] = useState<number>();
const options = [
{ label: 'hello', value: 1, description: 'this is a description' },
{ label: 'hello 2', value: 2, description: 'second description' },
];
return (
<>
<Select
options={options}
value={value}
onChange={v => {
setValue(v.value);
}}
size="md"
{...getDynamicProps()}
/>
</>
);
};
/**
* Uses plain values instead of SelectableValue<T>
*/
export const multiPlainValue = () => {
const [value, setValue] = useState<string[]>();
......
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