Skip to content

Commit

Permalink
Fix example in ARIA: grid role (#37903)
Browse files Browse the repository at this point in the history
Replace the incorrect use of `rowIndex` with `colIndex` in the JavaScript example code for initializing the cell datasets.

This error resulted in incorrect `row` and `col` values on the cells, causing the navigation to not work correctly. Pressing PageDown resulted in an endless `do` ... `while` loop that nearly consumed all of my computer's memory over the next few minutes.
  • Loading branch information
krazy-j authored Feb 1, 2025
1 parent aee91c3 commit 59254d2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ trs.forEach((row) => {
row.querySelectorAll("td").forEach((el) => {
el.dataset.row = rowIndex;
el.dataset.col = colIndex;
rowIndex++;
colIndex++;
});
if (colIndex > maxCol) {
maxCol = colIndex - 1;
Expand Down

0 comments on commit 59254d2

Please sign in to comment.