From 6d2430e4c4ff51add0a16cb7d1bc31fbaa95b648 Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Wed, 6 Sep 2023 00:32:55 +0800 Subject: [PATCH 1/2] MDL-79057 gradereport_singleview: Remove tabindex > 0 for elements A tab index with a non-zero value messes up with the logical tab order of a page. --- .../report/singleview/classes/local/ui/dropdown_attribute.php | 1 - grade/report/singleview/classes/local/ui/text_attribute.php | 2 -- grade/report/singleview/templates/dropdown_attribute.mustache | 2 +- grade/report/singleview/templates/text_attribute.mustache | 3 +-- 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/grade/report/singleview/classes/local/ui/dropdown_attribute.php b/grade/report/singleview/classes/local/ui/dropdown_attribute.php index d2726304b6d70..1c30a8e2d35b7 100644 --- a/grade/report/singleview/classes/local/ui/dropdown_attribute.php +++ b/grade/report/singleview/classes/local/ui/dropdown_attribute.php @@ -105,7 +105,6 @@ public function html(): string { 'name' => $this->name, 'value' => $this->selected, 'text' => $options[$selected], - 'tabindex' => 1, 'disabled' => !empty($this->isdisabled), 'readonly' => $this->isreadonly, 'options' => array_map(function($option) use ($options, $selected) { diff --git a/grade/report/singleview/classes/local/ui/text_attribute.php b/grade/report/singleview/classes/local/ui/text_attribute.php index ead123e950089..164f1ec4e94f0 100644 --- a/grade/report/singleview/classes/local/ui/text_attribute.php +++ b/grade/report/singleview/classes/local/ui/text_attribute.php @@ -85,10 +85,8 @@ public function html(): string { $context->label = ''; if (preg_match("/^feedback/", $this->name)) { $context->label = get_string('feedbackfor', 'gradereport_singleview', $this->label); - $context->tabindex = '2'; } else if (preg_match("/^finalgrade/", $this->name)) { $context->label = get_string('gradefor', 'gradereport_singleview', $this->label); - $context->tabindex = '1'; } return $OUTPUT->render_from_template('gradereport_singleview/text_attribute', $context); diff --git a/grade/report/singleview/templates/dropdown_attribute.mustache b/grade/report/singleview/templates/dropdown_attribute.mustache index e2d225ab65fc4..d04a631708aae 100644 --- a/grade/report/singleview/templates/dropdown_attribute.mustache +++ b/grade/report/singleview/templates/dropdown_attribute.mustache @@ -33,7 +33,7 @@ {{/readonly}} {{^readonly}} - {{#options}} {{/options}} diff --git a/grade/report/singleview/templates/text_attribute.mustache b/grade/report/singleview/templates/text_attribute.mustache index 26ee2cf47f36c..008e238c08acd 100644 --- a/grade/report/singleview/templates/text_attribute.mustache +++ b/grade/report/singleview/templates/text_attribute.mustache @@ -24,7 +24,6 @@ "name": "Awesome-report", "label": "Text label", "value": "Text information", - "tabindex": "1", "disabled": "true" } }} @@ -33,6 +32,6 @@ {{/readonly}} {{^readonly}} {{#label}}{{/label}} - + {{/readonly}} From 92d78a75d76521e66ed1763a8f90a34d078ee912 Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Wed, 6 Sep 2023 10:32:33 +0800 Subject: [PATCH 2/2] MDL-79057 gradereport_singleview: Use proper hidden attribute value HTML attribute hidden="1" is invalid. It either needs to be set to an empty string or use the keyword "hidden" for its value. --- grade/report/singleview/classes/local/screen/tablelike.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grade/report/singleview/classes/local/screen/tablelike.php b/grade/report/singleview/classes/local/screen/tablelike.php index 5b4cc75c912b8..95ed3a0fdb958 100644 --- a/grade/report/singleview/classes/local/screen/tablelike.php +++ b/grade/report/singleview/classes/local/screen/tablelike.php @@ -243,7 +243,7 @@ public function bulk_insert() { return html_writer::tag( 'div', (new bulk_insert($this->item))->html(), - ['class' => 'singleview_bulk', 'hidden' => true] + ['class' => 'singleview_bulk', 'hidden' => 'hidden'] ); }