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

EuiComboBox shouldn't show as invalid unless told to by owner #1790

Closed
cjcenizal opened this issue Apr 3, 2019 · 2 comments · Fixed by #1796
Closed

EuiComboBox shouldn't show as invalid unless told to by owner #1790

cjcenizal opened this issue Apr 3, 2019 · 2 comments · Fixed by #1796
Assignees
Labels

Comments

@cjcenizal
Copy link
Contributor

This change has caused a slight regression for consumers of combo box. In our use case, we perform validation of the combo box and display an error message once the user has tabbed away. If the user just tabs to the clear button, then the combo box appears invalid but without any information for the user:

image

Once they've tabbed away completely, they get the information they need:

image

If we could revert the change I linked to I believe that would restore the desired behavior. CC @chandlerprall

@cjcenizal cjcenizal added the bug label Apr 3, 2019
@cjcenizal
Copy link
Contributor Author

cjcenizal commented Apr 3, 2019

As a sidenote, the combo box attempts to "submit" any input for conversion into a pill once the user tabs away, which should make the markAsInvalid logic unnecessary, I think.

@cjcenizal
Copy link
Contributor Author

After talking this over with @chandlerprall I understand that the intention behind the change was to surface an error for combo boxes where custom options have been disallowed, since this is the only scenario where this UX is relevant.

image

I think my original issue from the above screenshot can be addressed by removing the red underline invalid state when the user is still interacting with the combo box, e.g. has focused on the clear button. Then this behavior of showing an invalid state when there's lingering input won't even be manifested in my use case.

Beyond that, I'd suggest two additional changes:

  1. Some comments around the code I linked to, explaining the intended UX in the context of the combo boxes which disallow custom options.
  2. Update the docs in the screenshot with some error text to explain how the user can fix the invalid state, e.g. "Please select an option or delete your search." Though this does seem like a bit of a hassle for the user.

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

Successfully merging a pull request may close this issue.

2 participants