Skip to content

Commit

Permalink
MDL-79057 gradereport_singleview: Remove tabindex > 0 for elements
Browse files Browse the repository at this point in the history
A tab index with a non-zero value messes up with the logical tab order
of a page.
  • Loading branch information
junpataleta committed Sep 6, 2023
1 parent 3fddb90 commit bf9a2f4
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 6 deletions.
Expand Up @@ -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) {
Expand Down
2 changes: 0 additions & 2 deletions grade/report/singleview/classes/local/ui/text_attribute.php
Expand Up @@ -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);
Expand Down
Expand Up @@ -33,7 +33,7 @@
{{/readonly}}
{{^readonly}}
<label for="{{name}}" class="accesshide">{{label}}</label>
<select id="{{name}}" name="{{name}}" class="custom-select" tabindex="1" {{#disabled}}disabled{{/disabled}}>
<select id="{{name}}" name="{{name}}" class="custom-select" {{#disabled}}disabled{{/disabled}}>
{{#options}}
<option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
{{/options}}
Expand Down
3 changes: 1 addition & 2 deletions grade/report/singleview/templates/text_attribute.mustache
Expand Up @@ -24,7 +24,6 @@
"name": "Awesome-report",
"label": "Text label",
"value": "Text information",
"tabindex": "1",
"disabled": "true"
}
}}
Expand All @@ -33,6 +32,6 @@
{{/readonly}}
{{^readonly}}
{{#label}}<label for="{{name}}" class="accesshide">{{label}}</label>{{/label}}
<input id="{{name}}" name="{{name}}" type="text" value="{{value}}" class="form-control" {{#tabindex}}tabindex="{{.}}"{{/tabindex}} {{#disabled}}disabled{{/disabled}}>
<input id="{{name}}" name="{{name}}" type="text" value="{{value}}" class="form-control" {{#disabled}}disabled{{/disabled}}>
<input type="hidden" name="old{{name}}" value="{{value}}">
{{/readonly}}

0 comments on commit bf9a2f4

Please sign in to comment.