Skip to content

Commit

Permalink
Fixes #1847 - Fixed the issue in the TaxonomyTree
Browse files Browse the repository at this point in the history
where the selection of multiple terms is allowed
despite the allowMultipleSelection prop being set to false.
  • Loading branch information
D'Andrea Nello committed Dec 17, 2024
1 parent 873aa00 commit df45373
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/controls/modernTaxonomyPicker/taxonomyTree/TaxonomyTree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -653,16 +653,21 @@ export function TaxonomyTree(
IChoiceGroupStyles
> = { root: { flex: "1" }, flexContainer: { width: "100%" } };

const getSelectedKey = (): string | null => {
const selectedItems = props.selection?.getSelection() as ITermInfo[] | undefined;
return selectedItems?.[0]?.id ?? null;
};



return (
<FocusZone
direction={FocusZoneDirection.horizontal}
className={styles.taxonomyItemFocusZone}
>
<ChoiceGroup
options={options}
selectedKey={
props.selection && props.selection.getSelection()[0]?.id
}
selectedKey={getSelectedKey()}
disabled={isDisabled}
styles={choiceGroupStyles}
/>
Expand Down

0 comments on commit df45373

Please sign in to comment.