Skip to content

Commit bbdd333

Browse files
chore(ReactFlow): updated guidance for a11y (#4897)
* chore(ReactFlow): updated guidance for a11y * Erin feedback
1 parent b8132f0 commit bbdd333

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

packages/documentation-site/patternfly-docs/content/AI/generative-uis/compass/CompassReactFlowDemo.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ const AddNodeOnEdgeDrop = () => {
227227
fitView
228228
fitViewOptions={{ padding: 2 }}
229229
nodeOrigin={nodeOrigin}
230+
aria-label="React flow demo"
230231
>
231232
<Background />
232233
</ReactFlow>

packages/documentation-site/patternfly-docs/content/AI/generative-uis/compass/ReactFlow.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,16 @@ This list outlines the overrides used in the following example, which also rende
5050
| --xy-handle-border-color-default | var(--pf-t--global--border--color--alt) |
5151

5252
```js file="./CompassReactFlowDemo.tsx"
53-
```
53+
```
54+
55+
### Accessibility considerations
56+
57+
While React Flow is built with accessibility in mind, you should always check that your implementation (when paired with PatternFly) is accessible via mouse, keyboard, and other assistive technologies like screen readers.
58+
59+
Additionally, you should align with the following practices:
60+
61+
- Provide an accessible name to the `<ReactFlow>` component, if its default role of "application" is kept or if it is given another semantic role that requires an accessible name.
62+
- Because React Flow supports node clicking and dragging, ensure that actions within draggable nodes are large enough to prevent misclicks (for example, kebab toggles, links, or other action buttons).
63+
- [WCAG 2.5.8: Target size (Minimum)](https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum) requires targets to be at least 24 by 24 CSS pixels. While there are exceptions, you should still aim for this minimum because a React Flow node itself can be clicked for some actions. This is especially important for an action like opening a details drawer upon a quick click to a node.
64+
- Ensure that any actions that can be taken via mouse only can be taken via keyboard as well, including all actions within a node and node repositioning via dragging.
65+
- Dragging nodes via keyboard should be built into React Flow itself by default, but always double check to confirm.

0 commit comments

Comments
 (0)