PanelEditor Fix missing labels and description if there is only single option in category (#24905)
(cherry picked from commit bb099cb141)
This commit is contained in:
committed by
Hugo Häggmark
parent
045b8629a4
commit
a930cba373
@@ -171,14 +171,11 @@ export const DefaultFieldConfigEditor: React.FC<Props> = ({ data, onChange, conf
|
|||||||
: undefined
|
: undefined
|
||||||
: (defaults as any)[item.path];
|
: (defaults as any)[item.path];
|
||||||
|
|
||||||
const label =
|
const label = (
|
||||||
categoryItemCount > 1 ? (
|
<Label description={item.description} category={item.category?.slice(1)}>
|
||||||
<Label description={item.description} category={item.category?.slice(1)}>
|
{item.name}
|
||||||
{item.name}
|
</Label>
|
||||||
</Label>
|
);
|
||||||
) : (
|
|
||||||
undefined
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Field label={label} key={`${item.id}/${item.isCustom}`}>
|
<Field label={label} key={`${item.id}/${item.isCustom}`}>
|
||||||
|
|||||||
Reference in New Issue
Block a user