-
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
Open
v-baambati
wants to merge
16
commits into
microsoft:master
Choose a base branch
from
v-baambati:May_2026BugFixes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
374a473
Updated bar role from image to button based on the props to fix voice…
v-baambati e9e7c8f
Added change file
v-baambati b94c045
Updated bar role from image to button based on the props to fix voice…
v-baambati 9639b2e
Updated bar role from image to button based on the props to fix voice…
v-baambati 64d2e56
Merge branch 'master' of https://github.com/microsoft/fluentui into M…
v-baambati 453a8c2
Updated snashots
v-baambati d757798
Updated snashots
v-baambati 3d21570
Updated failed test cases
v-baambati f44e621
Merge branch 'master' of https://github.com/microsoft/fluentui into M…
v-baambati dc2891b
Merge branch 'master' of https://github.com/microsoft/fluentui into M…
v-baambati 2ddac2c
updated role type
v-baambati 1f54ba9
updated role type
v-baambati 09411a4
updated snapshots
v-baambati 57e6067
updated test cases to fix build issue
v-baambati 2e79b5b
updated snapshots
v-baambati 2704593
Merge branch 'master' of https://github.com/microsoft/fluentui into M…
v-baambati File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@fluentui-react-charts-50b75273-008f-4416-bf72-db392da9bdc5.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -48,6 +48,16 @@ export const HorizontalBarChart: React.FunctionComponent<HorizontalBarChartProps | ||||||||||||||||||||||||||||
| const [selectedLegend, setSelectedLegend] = React.useState<string>(''); | |||||||||||||||||||||||||||||
| const [activeLegend, setActiveLegend] = React.useState<string>(''); | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| // Utility to check if a bar is interactive | |||||||||||||||||||||||||||||
| const _isBarInteractive = (point: ChartDataPoint): boolean => { | |||||||||||||||||||||||||||||
| return Boolean(point.onClick) || (!props.hideTooltip && point.legend !== ''); | |||||||||||||||||||||||||||||
| }; | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| // Utility to determine ARIA role for bar | |||||||||||||||||||||||||||||
| const _getAriaRole = (point: ChartDataPoint): 'button' | 'img' => { | |||||||||||||||||||||||||||||
| return _isBarInteractive(point) ? 'button' : 'img'; | |||||||||||||||||||||||||||||
| }; | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| function _refCallback(element: SVGGElement, legendTitle: string | undefined): void { | |||||||||||||||||||||||||||||
| _refArray.push({ index: legendTitle, refElement: element }); | |||||||||||||||||||||||||||||
| } | |||||||||||||||||||||||||||||
|
|
@@ -320,13 +330,15 @@ export const HorizontalBarChart: React.FunctionComponent<HorizontalBarChartProps | ||||||||||||||||||||||||||||
| _showToolTipOnSegment && point.legend !== '' ? event => _hoverOn(event, xValue, point) : undefined | |||||||||||||||||||||||||||||
|
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. 🕵🏾♀️ visual changes to review in the Visual Change Reportvr-tests-react-components/Charts-DonutChart 1 screenshots
vr-tests-react-components/Positioning 2 screenshots
vr-tests-react-components/ProgressBar converged 3 screenshots
|
|||||||||||||||||||||||||||||
| } | |||||||||||||||||||||||||||||
| onFocus={_showToolTipOnSegment && point.legend !== '' ? event => _hoverOn(event, xValue, point) : undefined} | |||||||||||||||||||||||||||||
| role="img" | |||||||||||||||||||||||||||||
| role={_getAriaRole(point)} | |||||||||||||||||||||||||||||
| 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()) && _isBarInteractive(point) ? 0 : undefined | |||||||||||||||||||||||||||||
| } | |||||||||||||||||||||||||||||
| /> | |||||||||||||||||||||||||||||
| ); | |||||||||||||||||||||||||||||
| }); | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This condition looks inconsistent across charts.
props.hideTooltipdoes not clearly represent interactivity. It only prevents the popover/callout from being shown.Checking
point.legend !== ''works for placeholder bars, but it could fail when a user intentionally sets the legend to an empty value for a real data series. Also, since we do not acceptonClickor similar interaction props for placeholder bars, this additional check may not even be necessary.I think we have two possible approaches:
Or, if we want only highlighted bars to be clickable:
The 2nd option seems more appropriate but adopting it would require updating all charts to maintain consistent behavior across the library.
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.
@AtishayMsft your inputs on this?