[EuiSuggest] Fire onItemClick callback on Enter key presses; [EuiSelectable] Fix Enter and Space key to select items on non-searchable listboxes#5693
Conversation
- under the hood, this uses EuiSelectable's onChange callback to capture item selection events
…iSelectable - since onChange handles this for us automatically, we no longer need to manually pass an onClick handler + remove logic for conditional `button` styling - as far as I can tell this was no longer being used/in play since the EuiSelectable refactor
…n non-`searchable` listboxes + minor comment reorganization + add Cypress tests to ensure we don't get regressions on this in the future
… users when selecting items - This enhancement allows users who click a list item and then still want to use keyboard nav or enter/space keys to select a list item to do so - Prevoiusly, the event.target checks were preventing this from occurring
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5693/ |
|
Thank you so much for speedy efforts here @constancecchen! Since there were so many changes to In addition to the the suggestion selection changes you've implemented here, I'm seeing a need for quite a bit more control around some of the internal components. For instance:
So at this point, the LoE/scope here starts ballooning 🎈 quite a bit, and this component would need to start being waaaay more opinionated, and would just be marching towards Kibana's All that said, I want to be conscious of your-all's time, and it seems like I should either go the custom component route (mirroring the suggestion UI like the |
chandlerprall
left a comment
There was a problem hiding this comment.
One small nit in a test file, otherwise this LGTM; tested in the preview build, including the steps included in the PR description; also pulled & poked at the code locally.
For the release consideration, we shouldn't have any problem getting the next EUI release into Kibana before FF; unless there's some needed coordination with changes in Kibana holding off on a backport should be fine. We can also do the backport if it helps any coordination or avoids creating stress somewhere.
cf3ca75 to
c5cd06b
Compare
- While keeping EuISuggest's onClick cleanup - note that resulting types shenanigans makes passing just EuiSuggestItem no longer possible, so I opted to just pass in an inline fn
c5cd06b to
f9e9b54
Compare
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5693/ |
thompsongl
left a comment
There was a problem hiding this comment.
Functionality confirmed with the QA steps (thanks for those!)
I strongly feel this PR should get into a patch/backport release and be added to elastic/kibana#126926
We may need a patch for ^ release anyway. We can coordinate after I have a little more info.
|
Sounds great, thanks Greg!! 👍 |
Summary
This is a PR in two slightly separate parts. I recommend following along by commit; the first 2 commits deal with EuiSuggest, and the last 2 commits deal with EuiSelectable (which somewhat floats up to affect EuiSuggest). If requested I can break these up into 2 separate PRs for EuiSuggest and EuiSelectable.
Release considerations
I strongly feel this PR should get into a patch/backport release and be added to elastic/kibana#126926 for two reasons:
QA
EuiSuggest
EuiSelectable
Checklist
- [ ] Check against all themes for compatibility in both light and dark modes- [ ] Checked in mobile- [ ] Checked in Chrome, Safari, Edge, and Firefox- [ ] Props have proper autodocs and playground toggles- [ ] Added documentation- [ ] Checked Code Sandbox works for any docs examples- [ ] Checked for breaking changes and labeled appropriately