Remove the clear button from the tab order

Created on 1 May 2024, 9 months ago
Updated 22 May 2024, 8 months ago

Problem/Motivation

A follow up to Ability to clear keyword/search filter with one click Needs work discussed in https://drupal.slack.com/archives/C01UHB4QG12/p1713974496119919. Based on the recommendation of Scott oHara it is recommendable to exclude the the clear button from the tab order. The corresponding blog post can be found here: https://www.scottohara.me/blog/2022/02/19/custom-clear-buttons.html and the explanation for the underlaying problem here: https://scottaohara.github.io/clear-text-field-button/

The clear button is purposefully not in the tabbing order of the web page. Keyboard users can use the Delete or Backspace keys (or first select all the text field’s text and then use these keys) to delete the contents of the text field.
Important: if the clear button was part of the web page’s tabbing order, every text field a user had entered data into would then require that they tab past the clear button that they have no use for. This clear button being useless to them if they had filled out the field with the data they intended. Adding clear buttons to the web page’s tabbing order is not recommended for this reason, as it has the potential to require two keyboard focus stops for every text field on the page that has a clear button.

In the context of Project Browser it isn't that much of a pressing issue since there aren't 7 or 8 fields with clear buttons on the same page where each would require an extra tab but still for the sake for consistency it might be adviceable to remove the clear button from the tab order. as mentioned in the quote the keyboard user can use the delete and or backspace button plus in the context of project browser there is also the option to press the esc button but at the same time the clear button is also still available in the AOM since it is marked up as a button.

Steps to reproduce
  • Go to /admin/modules/browse
  • Enter something in the search field
  • tab one time to reach the clear button

Proposed resolution

Remove the clear button from the tab order

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇩🇪Germany rkoller Nürnberg, Germany

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024