Focus search on open + add aria attributes

Created on 3 July 2025, 9 days ago

Problem/Motivation

One thing that bugs the πŸ’© of me on websites, is when I open up the search drawer, and then I have to click AGAIN to put the cursor in the search input. This steals seconds from me per year!

Anyway, lets fix this on Drupal.org, and make the web a better place.

While we're there, we should also make use of the aria-expanded and aria-controls attributes, which inform screen readers of the current state of things.

πŸ“Œ Task
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States mherchel Gainesville, FL, US

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @mherchel
  • Merge request !175Add aria attribute to search / focus on open. β†’ (Merged) created by mherchel
  • Pipeline finished with Success
    9 days ago
    Total: 159s
    #538533
  • πŸ‡ΊπŸ‡ΈUnited States mherchel Gainesville, FL, US

    This is ready for review. A couple notes:

    • Both mobile and desktop search buttons now toggle aria-expanded
    • After opening the search drawer (both mobile and desktop), the search input will now focus.
    • Open / close animation is much smoother now. There was some weirdness before that was being solved with a transition delay on the search form.
    • I added testing instructions to the IS
  • Pipeline finished with Success
    8 days ago
    Total: 226s
    #538622
  • Pipeline finished with Success
    8 days ago
    Total: 153s
    #538717
  • First commit to issue fork.
  • Pipeline finished with Skipped
    3 days ago
    #542811
  • πŸ‡ͺπŸ‡ΈSpain fjgarlin

    I reviewed the code and tested everything locally and it all works as expected. Thanks!

    Merging this. It will go with the next deployment to the site.

Production build 0.71.5 2024