Accessibility: Enable rule jsx-a11y/no-noninteractive-element-interactions (#58077)

* fixes for no-noninteractive-element-interactions

* remaining fixes

* add type="button"

* fix unit tests
This commit is contained in:
Ashley Harrison
2022-11-03 10:55:58 +00:00
committed by GitHub
parent 65bd5c65d8
commit 514d3111f4
16 changed files with 79 additions and 65 deletions

View File

@@ -265,7 +265,7 @@ class LegendTable extends PureComponent<Partial<LegendComponentProps>> {
}
return (
<table>
<table role="grid">
<colgroup>
<col style={{ width: '100%' }} />
</colgroup>

View File

@@ -107,7 +107,7 @@ export class LegendItem extends PureComponent<LegendItemProps, LegendItemState>
if (asTable) {
return (
<tr className={`graph-legend-series ${seriesOptionClasses}`}>
<td>
<td role="gridcell">
<div className="graph-legend-series__table-name">{seriesLabel}</div>
</td>
{valueItems}
@@ -221,7 +221,7 @@ interface LegendValueProps {
function LegendValue({ value, valueName, asTable, onValueClick }: LegendValueProps) {
if (asTable) {
return (
<td className={`graph-legend-value ${valueName}`} onClick={onValueClick}>
<td role="gridcell" className={`graph-legend-value ${valueName}`} onClick={onValueClick}>
{value}
</td>
);