Skip to content

Commit

Permalink
MDL-78550 grade: Hide empty filler rows from the accessibility tree
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta committed Jul 28, 2023
1 parent 997d5e4 commit 5c0af05
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions grade/edit/tree/lib.php
Expand Up @@ -300,11 +300,13 @@ public function build_html_tree($element, $totals, $parents, $level, &$row_count
$parentcategories = array_merge($rowclasses, [$eid]);
$emptyrow->attributes['class'] = 'spacer ' . implode(' ', $parentcategories);
$emptyrow->attributes['data-hidden'] = 'false';
$emptyrow->attributes['aria-hidden'] = 'true';

$headercell = new html_table_cell();
$headercell->header = true;
$headercell->scope = 'row';
$headercell->attributes['class'] = 'cell column-rowspan rowspan';
$headercell->attributes['aria-hidden'] = 'true';
$headercell->rowspan = $row_count;
$emptyrow->cells[] = $headercell;

Expand All @@ -314,6 +316,7 @@ public function build_html_tree($element, $totals, $parents, $level, &$row_count
$endcell = new html_table_cell();
$endcell->colspan = (19 - $level);
$endcell->attributes['class'] = 'emptyrow colspan ' . $levelclass;
$endcell->attributes['aria-hidden'] = 'true';

$returnrows[] = new html_table_row(array($endcell));

Expand Down

0 comments on commit 5c0af05

Please sign in to comment.