[EuiSuggest] Use EuiSelectable#5157
Conversation
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5157/ |
|
I had an idea for a custom hook that would provide stateful logic and ARIA attributes needed to make combox-like components that we could use here and elsewhere. Going to look into that before determining the best path forward for this PR. |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5157/ |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5157/ |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5157/ |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5157/ |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5157/ |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5157/ |
|
@1Copenut Before I open this up for full review, would you mind checking this for a11y completeness? I'd like to have that part solid before making further review adjustments. |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5157/ |
Looks like a focus trap change in #5584 had an impact here. Still trying to diagnose. Update: |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5157/ |
Maybe these could be removed in non-virtualized instances? Perhaps @cchaos has thoughts.
This is a noted limitation of virtualized
Yep, separate PR makes sense. In that same PR I can resolve @1Copenut concern about the input clear button not responding to ENTER. Both of these are
You could |
1Copenut
left a comment
There was a problem hiding this comment.
👍 I retested for keyboard and screen reader behavior with VO + Safari on MacOS Big Sur. The focus handling is spot on and the reduced set of options when I started typing worked well too. VO tends to be fairly verbose and repetitive, so I have no doubt this will be a big upgrade for NVDA and JAWS too. Thanks @thompsongl !
cee-chen
left a comment
There was a problem hiding this comment.
Mostly minor/optional comments, and a few maybe-blocking comments about unit tests
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5157/ |
|
|
||
| describe('EuiSuggest', () => { | ||
| describe('onItemClick', () => { | ||
| it('is called when an option is clicked', () => { |
There was a problem hiding this comment.
🤩 Nice!! These Cypress tests are great!!! Thanks for adding them!
cee-chen
left a comment
There was a problem hiding this comment.
New tests look awesome! I have just one super minor/opinionated code style suggestion, feel free to ignore it and merge if you don't think it's a significant improvement
Co-authored-by: Constance <constancecchen@users.noreply.github.com>
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5157/ |




Summary
Resolves #3733 by converting the list element in
EuiSuggestto useEuiSelectable, which now implements the ARIA 1.2 combobox pattern.Other changes:
EuiSelectabledoes the heavy liftingEuiSuggestInputaria-labeloraria-labelledbysendValueprop toonSearchChangeCloses #5336, closes #2404, closes #4419, closes #4345, closes #4342
Checklist
- [ ] Checked in mobile