Skip to content

Commit baef45a

Browse files
committed
fix(dashboards): name the chart readout group only when it has values
1 parent f5d2293 commit baef45a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎apps/sim/components/charts/time-series-chart.tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@ export function TimeSeriesChart({ label, option, ...config }: TimeSeriesChartPro
1919
const valuesRef = useRef<HTMLDivElement>(null)
2020
const edges = useScrollEdges(valuesRef, { axis: 'x' })
2121
const [readout, setReadout] = useState<ChartReadout | null>(null)
22+
const hasValues = Boolean(readout?.values.length)
2223
return (
2324
<div className='h-full min-w-0'>
2425
<div
25-
role='group'
26+
role={hasValues ? 'group' : undefined}
2627
className='mb-2 flex h-8 min-w-0 items-center justify-between gap-4 text-sm tabular-nums'
27-
aria-label={`${label} values`}
28+
aria-label={hasValues ? `${label} values` : undefined}
2829
>
2930
<div
3031
ref={valuesRef}

0 commit comments

Comments
 (0)