diff --git a/src/components/measurements/measurement-list.tsx b/src/components/measurements/measurement-list.tsx index 4946b37b2..99824c470 100644 --- a/src/components/measurements/measurement-list.tsx +++ b/src/components/measurements/measurement-list.tsx @@ -525,6 +525,11 @@ export function MeasurementList({ onEdit, onAddFirst }: MeasurementListProps) { const isExpanded = isGrouped ? expandedDayKeys.has(m.dayKey as string) : false; + // v1.4.38 W-D P1-1 — stable drill-down id so the + // disclosure chevron can thread aria-controls to the + // expanded panel. dayKey is unique per row when + // grouped; fall back to m.id otherwise. + const drilldownId = `drilldown-desktop-${m.dayKey ?? m.id}`; return ( @@ -585,6 +590,7 @@ export function MeasurementList({ onEdit, onAddFirst }: MeasurementListProps) { toggleExpand(m.dayKey as string) } aria-expanded={isExpanded} + aria-controls={drilldownId} aria-label={ isExpanded ? t("measurements.collapseDay") @@ -617,7 +623,7 @@ export function MeasurementList({ onEdit, onAddFirst }: MeasurementListProps) { {isGrouped && isExpanded && ( - + toggleExpand(m.dayKey as string)} aria-expanded={isExpanded} + aria-controls={drilldownId} aria-label={ isExpanded ? t("measurements.collapseDay") @@ -742,12 +751,14 @@ export function MeasurementList({ onEdit, onAddFirst }: MeasurementListProps) { {isGrouped && isExpanded && ( - +
+ +
)} );