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

[EuiSuggest] euiPanel should not be rendered in case of no suggestions #4344

Closed
alexwizp opened this issue Dec 4, 2020 · 3 comments · Fixed by #4349
Closed

[EuiSuggest] euiPanel should not be rendered in case of no suggestions #4344

alexwizp opened this issue Dec 4, 2020 · 3 comments · Fixed by #4349

Comments

@alexwizp
Copy link
Contributor

alexwizp commented Dec 4, 2020

Currently if we pass [](Empty array) into suggestions property we anyway render euiPanel:

image

It causes some issues:

  1. wrong animation effects

Screen Recording 2020-12-04 at 12 18 00 PM (1)

  1. keyboard navigation issues. If user press Tab button, we set focus into euiPanel instead of next form control
@thompsongl
Copy link
Contributor

Would it make sense to have some kind of empty state or prompt in the panel instead of hiding it?
For instance, EuiComboBox is similar and provides feedback to the user that no options match:
image

Related: #4302

@cchaos
Copy link
Contributor

cchaos commented Dec 7, 2020

I think there's some overall component confusion as to the use-case for EuiSuggest. Most of these new issues revolving around EuiSuggest are trying to replicate functionality that already exists as a part of the EuiComboBox. I added this comment to the Draft PR on the Kibana side to start a discussion as to whether these should be aligned or using EuiComboBox is the better component.

@elizabetdev
Copy link
Contributor

I agree with @cchaos. The purpose of the EuiSuggest is different than the EuiComboBox. If we want to match options we should use EuiComboBox where if something isn't matched the user is informed that nothing was matched.

For the EuiSuggest the suggestions should only appear if what we typing has a suggestion. If something doesn't match any suggestion the popover shouldn't open.

With that said, I think if we pass an empty array to EuiSuggest a blank popover shouldn't open and this PR makes sense:
#4349

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants