Skip to content

Commit a4b0786

Browse files
committed
fix(react-tree): remove comments and add change file
1 parent cc3ebd5 commit a4b0786

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Tree selection checkbox/radio is now exposed with an accessible name so Voice Access users can select items.",
4+
"packageName": "@fluentui/react-tree",
5+
"email": "paulmardling@microsoft.com",
6+
"dependentChangeType": "patch"
7+
}

packages/react-components/react-tree/library/src/components/TreeItemLayout/useTreeItemLayout.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,6 @@ export const useTreeItemLayout_unstable = (
6767
const checked = useTreeItemContext_unstable(ctx => ctx.checked);
6868
const isBranch = useTreeItemContext_unstable(ctx => ctx.itemType === 'branch');
6969

70-
// Id of the item content, used to give the selection control an accessible name so that
71-
// assistive technologies which target the visible control directly (e.g. Voice Access) can
72-
// reach it. See https://aka.ms/MAS4.3.1
7370
const mainContentId = useId('fui-TreeItemLayout__main-');
7471

7572
// FIXME: Asserting is required here, as converting this to RefObject on context type would be a breaking change
@@ -240,7 +237,6 @@ export const useTreeItemLayout_unstable = (
240237
),
241238
iconBefore: slot.optional(iconBefore, { elementType: 'div' }),
242239
main: slot.always(main, {
243-
// Only expose an id when there is a selector that needs to reference it for its name.
244240
defaultProps: { id: selectionMode !== 'none' ? mainContentId : undefined },
245241
elementType: 'div',
246242
}),

packages/react-components/react-tree/library/src/components/TreeItemPersonaLayout/useTreeItemPersonaLayout.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ export const useTreeItemPersonaLayout_unstable = (
5252
selector: (selectionMode === 'multiselect' ? Checkbox : Radio) as React.ElementType<CheckboxProps | RadioProps>,
5353
},
5454
avatarSize: treeAvatarSize[size],
55-
// Preserve the id assigned by useTreeItemLayout so the selector's `aria-labelledby`
56-
// (which names the selection control) keeps pointing at the primary content.
5755
main: slot.always(main, {
5856
defaultProps: { children, id: treeItemLayoutState.main.id },
5957
elementType: 'div',

0 commit comments

Comments
 (0)