-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Updated bar role from image to button based on the props to fix voice control issue in accessibility mode #36096
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 2 commits
374a473
e9e7c8f
b94c045
9639b2e
64d2e56
453a8c2
d757798
3d21570
f44e621
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "patch", | ||
| "comment": "Accessibility bug fix", | ||
| "packageName": "@fluentui/react-charts", | ||
| "email": "132879294+v-baambati@users.noreply.github.com", | ||
| "dependentChangeType": "patch" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -320,13 +320,18 @@ export const HorizontalBarChart: React.FunctionComponent<HorizontalBarChartProps | |
| _showToolTipOnSegment && point.legend !== '' ? event => _hoverOn(event, xValue, point) : undefined | ||
| } | ||
| onFocus={_showToolTipOnSegment && point.legend !== '' ? event => _hoverOn(event, xValue, point) : undefined} | ||
| role="img" | ||
| role={point.onClick || (!props.hideTooltip && point.legend !== '') ? 'button' : 'img'} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't setting the role as button sufficient for interactive elements? Why update tabIndex?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes @krkshitij these changes are sufficient but there is one more issue even non interactive element is focusable with customer for that we need to have tab index related changes. |
||
| aria-label={_getAriaLabel(point)} | ||
| onBlur={_hoverOff} | ||
| onMouseLeave={_hoverOff} | ||
| className={classes.barWrapper} | ||
| opacity={isLegendSelected ? 1 : 0.1} | ||
| tabIndex={_legendHighlighted(point.legend!) || _noLegendHighlighted() ? 0 : undefined} | ||
| tabIndex={ | ||
| (_legendHighlighted(point.legend!) || _noLegendHighlighted()) && | ||
| (point.onClick || (!props.hideTooltip && point.legend !== '')) | ||
| ? 0 | ||
| : undefined | ||
| } | ||
| /> | ||
| ); | ||
| }); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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/CalendarCompat 4 screenshots
vr-tests-react-components/Charts-DonutChart 1 screenshots
vr-tests-react-components/Positioning 2 screenshots
vr-tests-react-components/ProgressBar converged 3 screenshots
vr-tests-react-components/Skeleton converged 1 screenshots
There were 1 duplicate changes discarded. Check the build logs for more information.