Problem/Motivation

There are a quite a few instances of a class="use-ajax" without role="button" for links that don't open to a new page. This issue is to add the role="button" attribute to those links and to add a generic solution that would add the spacebar trigger to every a class="use-ajax" instance that should behave like a button.

https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/bu...

Steps to reproduce

Proposed resolution

1. Add role="button" attribute where necessary

2. Create a generic solution in the ajax library to allow users to be able to trigger links that have role="button" using the spacebar. There is
already an example of this being done in the media library in
Drupal.behaviors.MediaLibraryTabs in core/modules/media_library/js/media_library.ui.js

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
Screen Shot 2023-02-17 at 2.56.11 PM.png158.25 KBhooroomoo

Issue fork drupal-3342811

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

hooroomoo created an issue. See original summary.

hooroomoo’s picture

Title: Add role="button" and spacebar trigger to <a class="use-ajax"> that behave like a button » Add role="button" and spacebar trigger to <a class="use-ajax"> to behave like a button
hooroomoo’s picture

Issue summary: View changes
hooroomoo’s picture

Issue summary: View changes

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

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

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.