Skip to content

Hidden search panel should not contain focusable elements #455

@markaplet

Description

@markaplet

The search panel contains aria-hidden="true" however the close button element is still focusable. The recommendation is to use JavaScript to add or remove tabindex="-1" depending on the current visibility of the search. This is already happening for the input field and search button, but not applied to the close button as it should be. This appears to be fixed in the 5.5 version of the state template but not made it's way to the WP theme.

Here is the line of code from the container that has aria-hidden:
<div id="head-search" class="search-container hidden-print in play-animation focus" role="region" aria-label="Search Expanded" style="top: 96px;" aria-hidden="true">

Here is the close button code that needs to be included in the visibility toggle:
<button class="close-search width-50 height-50 border-0 bg-transparent pos-rel" type="reset"> <span class="sr-only">Close Search</span> <span class="ca-gov-icon-close-mark"></span> </button>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions