Skip to content

Commit

Permalink
Merge pull request #1924 from ferrarirosso/issue-1847
Browse files Browse the repository at this point in the history
Fixes #1847 - Multiple selections possible when allowMultipleSelection set to false
  • Loading branch information
joelfmrodrigues authored Dec 18, 2024
2 parents ac3d363 + df45373 commit ca83bc2
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 @@ -670,16 +670,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 ca83bc2

Please sign in to comment.