Add role="button" and spacebar trigger to <a class="use-ajax"> to behave like a button

Created on 17 February 2023, almost 2 years ago
Updated 16 May 2023, over 1 year ago

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

πŸ“Œ Task
Status

Active

Version

10.1 ✨

Component
AjaxΒ  β†’

Last updated about 5 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States hooroomoo

Live updates comments and jobs are added and updated live.
  • Accessibility

    It affects the ability of people with disabilities or special needs (such as blindness or color-blindness) to use Drupal.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024