Skip to content

Commit a71e95c

Browse files
niklubnik
andauthored
fix: FIT-411: Child Choices are disabled when 'leafsOnly' is used (#8146)
Co-authored-by: nik <nik@heartex.net>
1 parent 6f791dd commit a71e95c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

web/libs/editor/src/components/NewTaxonomy/NewTaxonomy.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,15 @@ const convert = (
8585

8686
const convertItem = (item: TaxonomyItem): AntTaxonomyItem => {
8787
const value = item.path.join(options.pathSeparator);
88-
const disabledNode = options.leafsOnly && (item.isLeaf === false || !!item.children);
88+
const isLeaf = item.isLeaf !== false && !item.children?.length;
89+
const disabledNode = options.leafsOnly && !isLeaf;
8990
const maxUsagesReached = options.maxUsagesReached && !selectedPaths.includes(value);
9091

9192
return {
9293
title: enrich(item),
9394
value,
9495
key: value,
95-
isLeaf: item.isLeaf !== false && !item.children,
96+
isLeaf,
9697
disableCheckbox: disabledNode || maxUsagesReached,
9798
children: item.children?.map(convertItem),
9899
};

0 commit comments

Comments
 (0)