address wrongful output of screen readers when interacting with KeyValue component - #18457
address wrongful output of screen readers when interacting with KeyValue component#18457aalves08 wants to merge 2 commits into
KeyValue component#18457Conversation
rak-phillip
left a comment
There was a problem hiding this comment.
I'm noticing a discrepancy with the announcements from the screen reader. I have the following setup to test this change:
This will read the following:
Foo1 Row2 Key Column1 Key for Row1 Edit Foo1
We are now announcing both "Row2" and "Row1" for the first input - this is still very confusing to navigate. I think that we need to fix the index for each of the inputs so that they match the row. We would need to update each of the possible input variants. It looks like CodeMirror only used index: i, while all others use index: i+1.
|
🔄 Auto-Retry Failed Run The Tests workflow run Follow up on the retried run here if needed: https://github.com/rancher/dashboard/actions/runs/30262245871 |



Summary
Fixes #14439
Occurred changes and/or fixed issues
aria-colcounton theKeyValuegrid to include the remove column when it is presentaria-rowcountto include the header row in the total countrole="rowgroup"androle="row"to the grouping divs so screen readers can build the correct grid ownership chain (grid → rowgroup → row → columnheader/gridcell)aria-rowindexandaria-colindexto all headercolumnheadercellsaria-rowindexfromi+1toi+2to account for the header row being row 1aria-rowindexandaria-colindexTechnical notes summary
The
KeyValuecomponent renders a CSS grid withrole="grid"but was missing the required ARIA ownership chain. Withoutrole="rowgroup"androle="row"on the intermediate wrapper divs, VoiceOver ignored the declaredaria-colcountand computed the column count from all visible cells combined, producing incorrect announcements like "6 columns, 2 rows" for a 3-column grid. The fix adds the missing roles and corrects all row/column index attributes throughout the header, data, and empty-state rows.Areas or cases that should be tested
KeyValuecomponent with one or more rows in edit mode — the screen reader should announce the correct column and row countsextraColumns(e.g. environment variable editor) that the column count adjusts correctlyAreas which could experience regressions
KeyValuecomponent: Labels & Annotations, Selectors, ConfigMaps, Secrets, environment variablesKeyValuecomponent slotname="remove"in the header (that slot was replaced with a plaindivwithrole="columnheader")Screenshot/Video
Checklist
Admin,Standard UserandUser Base