From b8fe5b3a0ea0b13a8676acfd39609316c63afd24 Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Wed, 6 Sep 2023 00:32:55 +0800 Subject: [PATCH] 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 d2726304b6d..1c30a8e2d35 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 @@ class dropdown_attribute extends element { '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 ead123e9500..164f1ec4e94 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 @@ class text_attribute extends element { $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 e2d225ab65f..d04a631708a 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 26ee2cf47f3..008e238c08a 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}}