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.
This commit is contained in:
Jun Pataleta 2023-09-06 00:32:55 +08:00
parent 00f0613f99
commit b8fe5b3a0e
No known key found for this signature in database
GPG Key ID: F83510526D99E2C7
4 changed files with 2 additions and 6 deletions

View File

@ -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) {

View File

@ -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);

View File

@ -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}}

View File

@ -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 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}}