fixed voice controll accessibility issue#36292
Conversation
📊 Bundle size reportUnchanged fixtures
|
|
Pull request demo site: URL |
| @@ -594,7 +594,7 @@ export const GroupedVerticalBarChart: React.FC<GroupedVerticalBarChartProps> = R | |||
| onClick={pointData.onClick} | |||
There was a problem hiding this comment.
🕵🏾♀️ visual changes to review in the Visual Change Report
vr-tests-react-components/Avatar Converged 1 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/Avatar Converged.badgeMask - RTL.normal.chromium.png | 5 | Changed |
vr-tests-react-components/Positioning 2 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/Positioning.Positioning end.chromium.png | 967 | Changed |
| vr-tests-react-components/Positioning.Positioning end.updated 2 times.chromium.png | 159 | Changed |
vr-tests-react-components/ProgressBar converged 2 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/ProgressBar converged.Indeterminate + thickness.default.chromium.png | 39 | Changed |
| vr-tests-react-components/ProgressBar converged.Indeterminate + thickness - Dark Mode.default.chromium.png | 73 | Changed |
| onFocus={_showToolTipOnSegment && point.legend !== '' ? event => _hoverOn(event, xValue, point) : undefined} | ||
| role="img" | ||
| aria-label={_getAriaLabel(point)} | ||
| role={index !== placeholderIndex ? 'option' : ''} |
There was a problem hiding this comment.
default role should be img
There was a problem hiding this comment.
list box not allowing us to keep img role for its children
| const keyVal = _uniqLineText + '_' + index; | ||
| const rawLegendVal = points!.chartData?.[0]?.legend || 'Series'; | ||
| const legendVal = | ||
| rawLegendVal |
There was a problem hiding this comment.
Aria-label will be something like below
EX: one, bar 1 of 3 with 2 data points
| return ( | ||
| <g | ||
| role="listbox" | ||
| aria-label={chartGroupAriaLabel} |
There was a problem hiding this comment.
Here, <g> represents an x-axis category group and not a series/legend
| {lineBorders.length > 0 ? <g>{lineBorders}</g> : null} | ||
| {lines.length > 0 ? <g>{lines}</g> : null} | ||
| <g>{dots}</g> | ||
| <g role="listbox" aria-label={chartGroupAriaLabel}> |
There was a problem hiding this comment.
Assign listbox role to the dotGroups instead. Each dotGroup contains data points of only 1 line series.
| <g | ||
| role="listbox" | ||
| id={keyVal} | ||
| aria-label={chartGroupAriaLabel} |
There was a problem hiding this comment.
Here, <g> represents a single horizontal bar (a primary bar + an optional placeholder bar) so no need to mention the number of data points in aria-label.
| return ( | ||
| <> | ||
| <g>{_bars}</g> | ||
| <g role="listbox" aria-label={chartGroupAriaLabel}> |
There was a problem hiding this comment.
Here, <g> contains all the bars. It would be better to create a <g> for all bars in each y-group.
| <> | ||
| <g {..._arrowNavigationAttributes}>{_bars}</g> | ||
| <g> | ||
| <g role="listbox" aria-label={chartGroupAriaLabel} {..._arrowNavigationAttributes}> |
There was a problem hiding this comment.
Here, <g> contains all the bars. Assign listbox role to the <g> representing each stack instead.
| <g role="listbox" aria-label={chartGroupAriaLabel} {..._arrowNavigationAttributes}> | ||
| {_bars} | ||
| </g> | ||
| <g role="listbox" aria-label={lineGroupAriaLabel}> |
There was a problem hiding this comment.
Here, <g> contains data points from all line series. It would be better to create a <g> for each line series.
| _yMin = Math.min(d3Min(_points, (point: VerticalBarChartDataPoint) => point.y)!, props.yMinValue || 0); | ||
| const legendBars: JSXElement = _getLegendData(_points); | ||
| const legendVal = _points[0]?.legend || 'Series'; | ||
| const chartGroupAriaLabel = `${legendVal}, bar chart with ${_points.length} bars and ${_points.length} data points.`; |
There was a problem hiding this comment.
No need to include chart related details here. Some of these details are already included in the chart title. Ensure that the aria label only contains info about what the <g> represents. Try not to repeat them. Do the same for other charts as well.

No description provided.