Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵🏾‍♀️ visual changes to review in the Visual Change Report

vr-tests-react-components/Menu 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Menu.Nested Submenus Small Viewport Stacked.nested menu.chromium.png 856 Changed
vr-tests-react-components/Menu Converged - submenuIndicator slotted content 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Menu Converged - submenuIndicator slotted content.default.submenus open.chromium.png 413 Changed
vr-tests-react-components/Menu Converged - submenuIndicator slotted content.default - RTL.submenus open.chromium.png 404 Changed
vr-tests-react-components/Positioning 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Positioning.Positioning end.updated 2 times.chromium.png 65 Changed
vr-tests-react-components/Positioning.Positioning end.chromium.png 17 Changed
vr-tests-react-components/ProgressBar converged 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/ProgressBar converged.Indeterminate + thickness - High Contrast.default.chromium.png 84 Changed
vr-tests-react-components/Skeleton converged 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Skeleton converged.Translucent Skeleton with rectangle.default.chromium.png 12 Changed
vr-tests-react-components/Tree 5 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Tree.flat tree multi selection - Dark Mode.flat tree multi selection selected 1-1.chromium.png 97 Changed
vr-tests-react-components/Tree.flat tree multi selection - High Contrast.flat tree multi selection selected 1-1.chromium.png 87 Changed
vr-tests-react-components/Tree.flat tree multi selection.flat tree multi selection selected 1-1.chromium.png 151 Changed
vr-tests-react-components/Tree.flat tree single selection - High Contrast.flat tree single selection selected 1.chromium.png 13 Changed
vr-tests-react-components/Tree.flat tree single selection - RTL.flat tree single selection selected 1.chromium_2.png 48 Changed

There were 3 duplicate changes discarded. Check the build logs for more information.

"type": "patch",
"comment": "fix: default selection behavior is accessible, with warnings",
"packageName": "@fluentui/react-tree",
"email": "sarah.higley@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,13 @@ export function useTreeItem_unstable(props: TreeItemProps, ref: React.Ref<HTMLDi
if (isEventFromActions() || isEventFromSubtree() || isEventFromSelection()) {
return;
} else if (!isEventFromExpandIcon) {
onClick?.(event);
if (typeof onClick === 'function') {
onClick(event);
}
// if onClick is not defined and the treeitem is selectable, then we should toggle the selection state on click
else if (selectionMode !== 'none') {
selectionRef.current?.click();
}
}
if (event.isDefaultPrevented()) {
return;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Accessibility

WARNING: Trees have many sometimes blocking accessibility issues across platforms and input modalities. Avoid using the component if possible.

Here are some accessibility edge cases scenarios we identified and users should keep in mind while using the `Tree` components.

NVDA
Expand All @@ -14,10 +16,11 @@ VoiceOver/Chromium

VoiceOver

1. [Bug 8223307](https://office.visualstudio.com/APEX/_workitems/edit/8223307): VoiceOver doesn't narrate level of tree
2. [Bug 8223375](https://office.visualstudio.com/APEX/_workitems/edit/8223375): VoiceOver doesn't list tree/table in the rotor
1. Not an external bug, but VoiceOver will not handle multiple actions (e.g. selection + a primary action, or a primary action + expand/collapse) on a single leaf node. This is down to how controls fundamentally work -- multiple actions on a single control are not accessible.
2. [Bug 8223307](https://office.visualstudio.com/APEX/_workitems/edit/8223307): VoiceOver doesn't narrate level of tree
3. [Bug 8223375](https://office.visualstudio.com/APEX/_workitems/edit/8223375): VoiceOver doesn't list tree/table in the rotor
iOS
3. [Bug 8232232](https://office.visualstudio.com/APEX/_workitems/edit/8232232): iOS : VoiceOver - Select tree with checkboxes - no narration of ticket/unticked state
4. [Bug 8232232](https://office.visualstudio.com/APEX/_workitems/edit/8232232): iOS : VoiceOver - Select tree with checkboxes - no narration of ticket/unticked state

JAWS

Expand All @@ -30,3 +33,9 @@ Narrator
1. [Bug 45975192](https://microsoft.visualstudio.com/OS/_workitems/edit/45975192): Single select tree - narration aria-selected makes verbosity with redundant "selected"
2. [Bug 46020629](https://microsoft.visualstudio.com/OS/_workitems/edit/46020629): Select tree with checkboxes - no narration of checked state
3. [Bug 46020726](https://microsoft.visualstudio.com/OS/_workitems/edit/46020726): Select tree with checkboxes - no able to toggle check state with space in scan mode

Voice Control and mobile screen readers (VoiceOver on iOS and Talkback)

Not an external bug, but all voice control softwares as well as mobile screen readers will not handle multiple actions (e.g. selection + a primary action, or a primary action + expand/collapse) on a single leaf node. This is down to how controls fundamentally work -- multiple actions on a single control are not accessible.

Trees also do not work with macOS voice control on chromium browsers at all. Similarly, VoiceOver on macOS has numerous quirks when interacting with trees.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ In addition to \`aside\` slot, both tree item layouts support \`actions\` slot t

The \`actions\` slot has a \`role="toolbar"\` and ensures proper horizontal navigation with the keyboard by using [\`useArrowNavigationGroup\`](https://react.fluentui.dev/?path=/docs/utilities-focus-management-usearrownavigationgroup--default).

> ⚠️ Although \`actions\` are easy to navigate, they're not an expected pattern according to [WAI-ARIA](https://www.w3.org/WAI/ARIA/apg/patterns/treeview/).providing a context menu with the same functionalities as the actions is recommended to ensure your tree item is accessible.
> ⚠️ Although \`aria-actions\` will improve accessibility in the future, the current state of actions is that they are inaccessible across multiple platforms and input modalities, such as voice control. They are also not allowed children of a treeitem per the ARIA spec. Providing a context menu with the same functionalities as the actions is recommended to improve the accessibility of actions.

In the example below, we compose on top of \`TreeItem\` component to include both a context menu and actions that provide the same amount of functionalities. We also provide an \`aria-description\` to the tree item to indicate that it has actions. This is a new behavior that the user might not be aware of, so you might need to explain somewhere else in the UI what does having actions refers to.

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ Selection.parameters = {
story: `
The tree component offers selectable functionality in both single and multi-selection modes. You can enable this feature by passing the \`selectionMode\` prop with either \`single\` or \`multiselect\` value.

⚠️ WARNING: trees that have multiple possible interactions on the same tree item (e.g. selection + a primary action, or selection + expand/collapse) are fundamentally inaccessible across multiple modalities, specifically mobile screen readers, VoiceOver on macOS, and voice control. Trees generally are not broadly accessible, and should be used very infrequently if at all. If you create a selectable tree, the best practice is to not also define an onClick for TreeItems.

Controlling selection state:

- \`Tree\`: In nested tree, you are responsible for controlling the selection state, as it would be difficult to manage the state in an uncontrolled manner without knowing the items upfront.
- \`FlatTree\`: In flat tree, you can take advantage of an uncontrolled state for easier management, as the items are known upfront. It is also possible to use a controlled state if you need to manage the selection state externally.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export { NavigationModeTreeGrid } from './TreeNavigationModeTreeGrid.stories';
export { DefaultOpen } from './TreeDefaultOpen.stories';
export { OpenItemsControlled } from './OpenItemsControlled.stories';
export { OpenItemControlled } from './OpenItemControlled.stories';
export { CustomizingInteraction } from './TreeCustomizingInteraction.stories';
export { InlineStylingTreeItemLevel } from './TreeInlineStylingTreeItemLevel.stories';
export { FlatTreeStory as FlatTree } from './FlatTree.stories';

Expand Down
Loading