Global Search - Header Search Keyboard Control
Intro
This change is broken off from !66007 (closed)
Additionally this change is further split off from a larger Approved A11y MR !70222 (merged)
Work towards #297396 (closed)
This change is behind a feature flag (:new_header_search
)
Feature Flag Rollout Issue: #339348 (closed)
This end goal here is to replace the large deprecated jquery component used for the Header Search: https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/assets/javascripts/search_autocomplete.js
Replacing it with GitLab UI will allow us to add features more effectively as well as true up the styles permanently by using the GitLab UI component.
What does this MR do and why?
This MR is the 5th of 6 MRs to fully refactor the deprecated component mentioned above. This MR is actually split off from the A11Y issue that is approved and waiting this MR's merge: !70222 (merged).
Here we are fulfilling the A11y requirement of full keyboard and arrow key navigation on the Header Search dropdown.
IMPORTANT: No aria tags have been added here. In the following MR we add the screen reader requirements.
Here is a full roadmap for when the missing features will be added: #297396 (comment 665578315)
Screenshots or screen recordings
Example of Keyboard A11y
How to setup and validate locally (strongly suggested)
- Fetch and checkout this branch
- From your GDK terminal, access the rails console by typing
rails c
- Enable the feature flag by typing
Feature.enable(:new_header_search)
- Navigate to your GDK homepage (
http://127.0.0.1:3000/
)
Dropdown focus
- Ensure clicking on the search box shows dropdown
- Ensure clicking off the dropdown/search box hides dropdown
- Ensure tabbing on the search box shows dropdown
- Ensure tabbing off the search box hides the dropdown
Clear button
- Focus the search field
- Type in a search
- Tab to the clear button
- Ensure dropdown hides
- Press enter
- Ensure search box clears, gets re-focused, and dropdown re-shows
Arrow Keys
- Focus the search field
- Optionally search/clear searches
- Ensure arrow keys allow you to navigate up/down on the dropdown
- Ensure you are able to continue to type in the search even when arrow keyed down on an item
- Ensure you are able to arrow key all the way up and re-focus the search field
- Hit enter on a focused dropdown item and ensure it navigates to where you expect
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.