Problem/Motivation

For users of screenreaders, the field label on every checkbox/radio button will be "Select this item", which makes it hard to distinguish which entity the are selected.

Steps to reproduce

Open a media browser, inspect the HTML and look at the <label> tag. Notice that the checkbox or radio button for every entity has a label of "Select this item".

Proposed resolution

Change the label to "Select item ENTITY_LABEL".

Remaining tasks

  1. Post the patch!

User interface changes

No visible changes - only the invisible label seen by screenreaders.

API changes

No API changes.

Data model changes

No 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

dsnopek created an issue. See original summary.

dsnopek’s picture

Status: Active » Needs review
StatusFileSize
new660 bytes

Here is the patch!

anybody made their first commit to this issue’s fork.

anybody’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +a11y

Thanks @dsnopek! I created a MR from your patch. This clearly improves the situation. Even better might be to use a configurable label from the views field. But let's treat that as follow-up.

  • anybody committed 6706b9b8 on 8.x-2.x
    Issue #3461919 by anybody, dsnopek: "Select this item" isn't a good...
anybody’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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

joevagyok’s picture

Latest release containing this is causing fatal error:
Error: Call to a member function label() on null in Drupal\entity_browser\Plugin\views\field\SelectForm->viewsForm() (line 129 of /var/www/html/build/modules/contrib/entity_browser/src/Plugin/views/field/SelectForm.php).

We should not assume the presence of _entity over there, sometimes it can be null.

grevil made their first commit to this issue’s fork.

grevil’s picture

Status: Closed (fixed) » Needs review

Please review new MR with the regression fix.

anybody’s picture

@joevagyok please test and review! :)

grevil’s picture

Status: Needs review » Reviewed & tested by the community

Changes LGTM!

joevagyok’s picture

Thank you for the fast resolution!

grevil’s picture

Status: Reviewed & tested by the community » Fixed

You are welcome!

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

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

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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