Problem/Motivation
The Select element does not have a label, so we should add one:
Effective form labels are required to make forms accessible. The purpose of form elements such as checkboxes, radio buttons, input fields, etcetera, is often apparent to sighted users, even if the form element is not programmatically labeled. Screen readers users require useful form labels to identify form fields. Adding a label to all form elements eliminates ambiguity and contributes to a more accessible product.
From https://dequeuniversity.com/rules/axe/4.12/select-name
Steps to reproduce
Check the source, and do not see a label for the select element.
Proposed resolution
We could add a label, which is hidden by default:
<label for="edit-sort-by" class="visually-hidden">Sort by</label>
<select onchange="this.form.submit();" data-drupal-selector="edit-sort-by" id="edit-sort-by" name="sort_by" class="form-select">
<option value="field_year|asc">Year: Low to High</option>
<option value="field_year|desc" selected="selected">Year: High to Low</option>
</select>Remaining tasks
User interface changes
API changes
Data model changes
Issue fork search_api_sorts_widget-3631573
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
ressaComment #4
peri22 commentedReviewed MR !12: the select now gets a visually hidden "Sort by" label tied to it, and the autosubmit is unaffected.
Thanks, merging.
Comment #6
peri22 commentedComment #8
peri22 commentedComment #10
ressaPerfect, thank you @peri22 for a fast response.
Comment #12
ressaBy the way, it looks like up to ten improvements were added recently in the dev-version, so maybe a fresh release could be considered?
Comment #13
peri22 commentedReleased as 1.0.0-beta6, thanks for the suggestion.
Comment #14
ressaFantastic, thank you @peri22, have a great weekend.