Grid: body rows render aria-rowindex="0", which is invalid (must be >= 1)
Version: @svar-ui/svelte-grid 2.7.3
What happens. In a populated grid, every body row is rendered with aria-rowindex="0".
Why it matters. WAI-ARIA defines aria-rowindex as an integer greater than or equal to 1: a row's 1-based position within the full set of rows, header rows included. axe-core reports aria-rowindex="0" as a critical aria-valid-attr-value violation, so any page containing a populated grid fails an automated accessibility audit.
Expected. 1-based indices that count the header row(s). With one header row, the first body row is aria-rowindex="2". Under virtual scrolling, each rendered row's index reflects its position in the full data set, with aria-rowcount on the grid giving the total.
Steps to reproduce. Render a <Grid> with any columns and a non-empty data array, then inspect any body row in the DOM, or run axe-core against the page.
Workaround in use. We exclude axe's aria-valid-attr-value rule for pages that render the grid, and keep a test that fails once the attribute becomes valid, so the exclusion can be removed.
Hello @ElmirSecerbegovicGEN79 ,
Thank you for reporting.
In a populated grid, every body row is rendered with aria-rowindex="0".
One small clarification here: currently, only the first rendered row has aria-rowindex="0", as shown in our samples: https://docs.svar.dev/svelte/grid/samples/#/base/willow . The subsequent rows should have increasing indices.
However, the issue you have highlighted is valid so it was passed to our developers. We will keep you updated on any progress.