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

Command icon 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

ressa created an issue. See original summary.

ressa’s picture

Status: Active » Needs review
peri22’s picture

Status: Needs review » Fixed

Reviewed MR !12: the select now gets a visually hidden "Sort by" label tied to it, and the autosubmit is unaffected.
Thanks, merging.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

peri22’s picture

Status: Fixed » Reviewed & tested by the community

peri22’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

ressa’s picture

Perfect, thank you @peri22 for a fast response.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

ressa’s picture

By the way, it looks like up to ten improvements were added recently in the dev-version, so maybe a fresh release could be considered?

peri22’s picture

Released as 1.0.0-beta6, thanks for the suggestion.

ressa’s picture

Fantastic, thank you @peri22, have a great weekend.