-
Notifications
You must be signed in to change notification settings - Fork 842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[EuiSelectableTemplateSitewide] Allow for default enter key action #6376
Comments
this is the direction I'm leaning as this aligns with similar search bars I spot checked around the web, but will discuss design & accessibility implications with the team |
Fair warning, this will be a wall of text. Problem statement:We want a way for the sitewide search component to let users execute a full domain search or pick a suggested result based on what they type. These two user flows must be fully accessible with a high degree of discoverability. Current implementation:Our sitewide-search component does the following:
Proposed change:Our iterated sitewide search would retain existing functionality, with a few differences:
The difference in behavior is subtle. Our current implementation is a List autocomplete with automatic selection. This is an example of WAI-ARIA combobox pattern 3. I am proposing we move to pattern 2, list autocomplete with manual selection. Combobox pattern 2 says users can select a suggested result by pressing an arrow key or clicking a result. This is an opt-in pattern that allows us to add a second path of "search everything" by pressing We can extend the SR-only instructions to describe this new "Press enter to search all results" workflow and amend them to say "Press down or right arrow to select a suggested result." Screen readers will always announce the number of suggested results as users type. I feel like this gets to the heart of the original description without disrupting user expectations of the combobox pattern or introducing new/unexpected focus behavior for assistive technology users. |
@constancecchen has raised a great point about the current sitewide search:
If we're adding a press Enter to view all search results a'la Gmail, this button might be unnecessary. If we remove "View more options", do we need a "Search" or "Go" button to afford mouse users the same search all results as keyboard users? Going back to the Gmail model, users can click the 🔎 after entering a search term to execute, same as pressing |
Another great suggestion from @constancecchen
|
👋 Hi there - this issue hasn't had any activity in 6 months. If the EUI team has not explicitly expressed that this is something on our roadmap, it's unlikely that we'll pick this issue up. We would sincerely appreciate a PR/community contribution if this is something that matters to you! If not, and there is no further activity on this issue for another 6 months (i.e. it's stale for over a year), the issue will be auto-closed. |
❌ Per our previous message, this issue is auto-closing after having been open and inactive for a year. If you strongly feel this is still a high-priority issue, or are interested in contributing, please leave a comment or open a new issue linking to this one for context. |
Going to re-open this as it has a fairly detailed writeup from Trevor that feels achievable |
👋 Hi there - this issue hasn't had any activity in 6 months. If the EUI team has not explicitly expressed that this is something on our roadmap, it's unlikely that we'll pick this issue up. We would sincerely appreciate a PR/community contribution if this is something that matters to you! If not, and there is no further activity on this issue for another 6 months (i.e. it's stale for over a year), the issue will be auto-closed. |
Hi, I have deleted this comment. Have a great day! |
hi team, after raising this thread with Chandler, he recommended we create an issue to address our concern: we'd like to configure
EuiSelectableTemplateSitewide
in such a way that the default behavior whenentering a search term
->results load
->pressing the enter key
can trigger an event of our choosing; in our case, we want to execute a sitewide search on a results page.currently,
entering a search term
->results load
->pressing the enter key
will always lead the user to selecting the first search result in the popover.I think we're officially agnostic on how to best implement this, but our suggestions seemed to be (in order of preference) 1. allow a "default selection" element selector to be passed in, so we can specificy the "View more results" link be the default selection when search results are first populated, 2. allow an arbitrary pseudo-result to be injected first in all search cases, allowing us to inject a "Search the site" item, 3. allow an "empty" default selection and a function to be passed when the enter key is pressed, so we can pass a navigate function to be executed if a user hasn't used the arrow keys to navigate through the results.
thanks for your time!
Related issue:
#6375
The text was updated successfully, but these errors were encountered: