Skip to content
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

[EuiSelectable]: onSearch should also return visibleOptions #5178

Conversation

eeston
Copy link

@eeston eeston commented Sep 14, 2021

Fixes #5165

EuiSelectable has no way (that I can see) of returning the visibleOptions list per character typed (with searchable: true). I've added this functionality to onSearch so that it now returns visibleOptions as the second parameter, as opposed to just the searchValue.

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
    - [ ] Added or updated jest tests
    - [ ] Checked for breaking changes and labeled appropriately
    - [ ] Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

@kibanamachine
Copy link

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@cla-checker-service
Copy link

cla-checker-service bot commented Sep 14, 2021

💚 CLA has been signed

@eeston eeston marked this pull request as draft September 14, 2021 09:44
@eeston eeston force-pushed the feat/5165-euiSelectable-onSearch-returns-visibleOptions branch from d719b6d to d938ddf Compare September 14, 2021 09:55
eeston pushed a commit to eeston/eui that referenced this pull request Sep 14, 2021
@eeston eeston force-pushed the feat/5165-euiSelectable-onSearch-returns-visibleOptions branch from d938ddf to d309ec4 Compare September 14, 2021 09:56
@eeston eeston marked this pull request as ready for review September 14, 2021 09:58
@cchaos
Copy link
Contributor

cchaos commented Sep 14, 2021

🙌 Welcome and thanks for the PR @eeston!

Would you please sign the CLA linked below (if you haven't already). Be sure to use the same email address linked to your Github account.

Also, if you can, please write a bit more in the description of the PR about how you went about fixing the linked issue, that would help us a lot in review.

I've also unchecked a PR checklist item about prop autodocs, since I think we should add a prop comment explaining what onSearch returns back to help others down the road.

But, I'll get our CI (Jenkins) started for you which will run our tests and get a preview built.

Jenkins, test this

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5178/

@eeston eeston force-pushed the feat/5165-euiSelectable-onSearch-returns-visibleOptions branch from 8bca6e8 to 428c65a Compare September 16, 2021 08:55
@eeston
Copy link
Author

eeston commented Sep 16, 2021

Hi @cchaos !

Thanks for the initial feedback. I've signed the CLA & I think I've covered everything I need to do in terms of prop autodocs. If there's anything else, please let me know.

In terms of PR information, there's some information here #5165. It has the intial issue I raised and a quick chat with @thompsongl about how to address it.

Quick summary: EuiSelectable has no way (that I can see) of returning the visibleOptions list per character typed (with searchable: true). I've added this functionality to onSearch so that it now returns visibleOptions as the second parameter, as opposed to just the searchValue.

@cchaos
Copy link
Contributor

cchaos commented Sep 16, 2021

Thanks for the context. Sometimes it's just helpful to reiterate in the PR itself as to the final approach taken.

Jenkins, test this

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5178/

@thompsongl
Copy link
Contributor

jenkins test this

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5178/

@thompsongl
Copy link
Contributor

jenkins test this

Copy link
Contributor

@thompsongl thompsongl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM; Thanks, @eeston!

@thompsongl thompsongl enabled auto-merge (squash) September 20, 2021 14:19
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5178/

@thompsongl thompsongl merged commit bf72cba into elastic:master Sep 20, 2021
@eeston
Copy link
Author

eeston commented Sep 21, 2021

Thanks @thompsongl

@eeston eeston deleted the feat/5165-euiSelectable-onSearch-returns-visibleOptions branch September 21, 2021 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[EuiSelectable]: should onSearch also return visibleOptions list?
4 participants