Skip to content

Commit

Permalink
chore: ensure TreeItem role can be overridden by props (#33277)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsunderhus authored Nov 15, 2024
1 parent 072ad5a commit d766af9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: ensure TreeItem role can be overridden by props",
"packageName": "@fluentui/react-tree",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,11 @@ export function useTreeItem_unstable(props: TreeItemProps, ref: React.Ref<HTMLDi
getIntrinsicElementProps(as, {
tabIndex: -1,
[dataTreeItemValueAttrName]: value,
role: 'treeitem',
...rest,
ref: useMergedRefs(ref, treeItemRef),
role: 'treeitem',
'aria-level': level,
'aria-checked': selectionMode === 'multiselect' ? checked : undefined,
// Casting: when selectionMode is 'single', checked is a boolean
'aria-selected': ariaSelected !== undefined ? ariaSelected : selectionMode === 'single' ? !!checked : undefined,
'aria-expanded': ariaExpanded !== undefined ? ariaExpanded : itemType === 'branch' ? open : undefined,
onClick: handleClick,
Expand Down

0 comments on commit d766af9

Please sign in to comment.