-
Notifications
You must be signed in to change notification settings - Fork 843
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
(Accessibility) [EuiSelectable] Unable to make selections when second interactable element in focus #6627
Comments
Here's the code that impacts this particular issue: eui/src/components/selectable/selectable.tsx Lines 335 to 359 in 784a553
Lines 350-358 are what's causing this "problem". That early return was originally added to prevent selection from happening when the search clear button was 'pressed' (via enter or space key). In theory, however, it applies to literally any wildcard custom content inside the So for example, if you added a custom button below the list that did some custom action (opened a modal, sent an email, loaded more items, etc.), wouldn't you want that item to not accidentally trigger selection as well? In theory, BTW, pressing Enter on your custom filter dropdown/button should be toggling its associated popover only, not triggering a selection. In theory, what would be a "complete" fix would be to also prevent the up/down arrow keys from changing selection if the searchbox or listbox isn't the current focus. However, I totally get the filter behavior you've added and that you want it to behave the same way / as seamlessly as the searchbox itself. I'm just not really certain there's a way to implement that while also implementing a way to ignore keydowns on children that shouldn't trigger selections. My personal instinct/recommendation for a fix would be:
Thoughts? This is definitely a complex problem to solve without a single clear/easy fix, FWIW. |
My main issue was simply the fact that, when our filter dropdown has the focus, there was still a visual indicator in the
100% agree! I don't know how that would work. If selections are only possible when either the Thanks for the thorough response, @cee-chen - your suggested fix makes total sense to me! 💃 |
…rm (#162067) Closes #162697 ## Summary This PR adds a few tiny UI improvements to the control creation elements, including... **Data view picker:** - Made the `Data view` form title respond to focus as expected | <div align="center">Before</div> | <div align="center">After</div> | |--------|--------| | ![Jul-28-2023 15-55-13](https://github.com/elastic/kibana/assets/8698078/c287978d-a54a-4809-a806-5a2caa41cf5d) | ![Jul-28-2023 15-56-24](https://github.com/elastic/kibana/assets/8698078/8f403c2d-80a5-4fc1-989a-1ecceb056fc9) | - Switched to use `EuiInputPopover` rather than `EuiPopover` - Removed the redundant popover title | <div align="center">Before</div> | <div align="center">After</div> | |--------|--------| | ![image](https://github.com/elastic/kibana/assets/8698078/013fc848-3a9a-4280-9b37-6c1f025f3597) | ![Screenshot 2023-07-28 at 4 16 18 PM](https://github.com/elastic/kibana/assets/8698078/22a2de30-cae1-49d4-9c33-d1537488d08d) | **Field picker:** - Made the `Field` form row title respond to focus as expected for all of the inner form elements | <div align="center">Before</div> | <div align="center">After</div> | |--------|--------| | ![Jul-28-2023 16-06-01](https://github.com/elastic/kibana/assets/8698078/7dd845bc-0476-4b2a-b9b5-efce3c2e2844) | ![Jul-28-2023 16-07-00](https://github.com/elastic/kibana/assets/8698078/222a9199-e5c2-4180-9501-e31588020855) | - Switched the `FieldTypeFilter` to use `EuiInputPopover` rather than `EuiPopover` - Removed the redundant title from the `FieldTypeFilter` popover | <div align="center">Before</div> | <div align="center">After</div> | |--------|--------| | ![image](https://github.com/elastic/kibana/assets/8698078/007c61db-989b-4615-a36f-5f6307f04aaf) | ![image](https://github.com/elastic/kibana/assets/8698078/ed7aea0c-d852-4f1c-ae03-14933fa2888a) | - Made changes described in elastic/eui#6627 (comment) so that, when the field type filter is closed (either via `Esc` or through the natural tab order), the focus returns to the search field | <div align="center">Before</div> | <div align="center">After</div> | |--------|--------| | ![Jul-28-2023 16-12-58](https://github.com/elastic/kibana/assets/8698078/aea49501-1f61-4ae8-bc90-1bacbbc232e7) | ![Jul-28-2023 16-13-54](https://github.com/elastic/kibana/assets/8698078/8068b090-9cca-427f-bc36-2b9e6b2324f1) | - If provided, the initial selected field is now brought to the top of the list | <div align="center">Before</div> | <div align="center">After</div> | |--------|--------| | ![image](https://github.com/elastic/kibana/assets/8698078/2bdad643-d184-4c80-b940-5a73820dc8a5) | ![image](https://github.com/elastic/kibana/assets/8698078/cda382e2-0e15-48c0-bdbf-c530a77570b8) | **Controls display settings:** - Surrounded the `Minimum width` row with a `div` so that it can receive the `id` passed down from the `EuiFormRow` and respond to focus as expected | <div align="center">Before</div> | <div align="center">After</div> | |--------|--------| | ![Jul-28-2023 16-31-56](https://github.com/elastic/kibana/assets/8698078/125d2a75-bcec-452c-8682-85de3a44185b) | ![Jul-28-2023 16-31-20](https://github.com/elastic/kibana/assets/8698078/935a17f1-4adc-4b86-811b-334a42e4627e) | ### Checklist - [x] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [x] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) - [x] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [x] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: Jatin Kathuria <jatin.kathuria@elastic.co>
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:To accomplish this, we are currently using the
searchable
prop and adding our filter component between the nativesearch
andlist
, like so:Unfortunately, this messes with the
a11y
support that was added to theEuiSelectable
component, since it seems to assume that all children should retain focus as the user navigates the list. This works great when thesearch
is in focus, but it gives a confusing experience when thefieldTypeFilter
is in focus, like so:In the above GIF, you can see that, while the
fieldTypeFilter
is in focus, the user is unable to make selections in thelist
despite it giving the appearance that they should be able to. It would be nice if only thesearch
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.The text was updated successfully, but these errors were encountered: