chore(controls): add custom aria labels

This commit is contained in:
Abbey Yacoe
2025-05-22 12:36:36 +02:00
parent 3c421d5f02
commit 74929f09bc
6 changed files with 9 additions and 5 deletions
@@ -36,11 +36,12 @@ function ControlsComponent({
children,
position = 'bottom-left',
orientation = 'vertical',
'aria-label': ariaLabel = 'React Flow controls',
'aria-label': ariaLabel,
}: ControlProps) {
const store = useStoreApi();
const { isInteractive, minZoomReached, maxZoomReached, labelConfig } = useStore(selector, shallow);
const { zoomIn, zoomOut, fitView } = useReactFlow();
const effectiveAriaLabel = ariaLabel ?? labelConfig['controls.ariaLabel'];
const onZoomInHandler = () => {
zoomIn();
@@ -74,7 +75,7 @@ function ControlsComponent({
position={position}
style={style}
data-testid="rf__controls"
aria-label={ariaLabel}
aria-label={effectiveAriaLabel}
>
{showZoom && (
<>