Skip to content

(Accessibility) [EuiSelectable] Unable to make selections when second interactable element in focus #6627

@Heenawter

Description

@Heenawter

For Dashboard input controls, we give users the ability to both search and filter the items in the EuiSelectable component as part of the creation/editing process:

Screenshot 2023-03-02 at 9 12 57 AM

To accomplish this, we are currently using the searchable prop and adding our filter component between the native search and list, like so:

<EuiSelectable
  searchable
  ...
>
{(list, search) => (
  <>
    {search}
    <EuiSpacer size={'s'} />
    {fieldTypeFilter} // this is our custom filter component
    <EuiSpacer size={'s'} />
    {list}
  </>
)}
</EuiSelectable>

Unfortunately, this messes with the a11y support that was added to the EuiSelectable component, since it seems to assume that all children should retain focus as the user navigates the list. This works great when the search is in focus, but it gives a confusing experience when the fieldTypeFilter is in focus, like so:

Mar-02-2023 09-28-26

In the above GIF, you can see that, while the fieldTypeFilter is in focus, the user is unable to make selections in the list despite it giving the appearance that they should be able to. It would be nice if only the search child retained focus in this way, whereas any other children did not - or, perhaps, if there was a way to control whether or not a child retained focus.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions