-
Notifications
You must be signed in to change notification settings - Fork 842
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 with no custom option: bug fix, cleaned up example, added comment #1796
EuiComboBox with no custom option: bug fix, cleaned up example, added comment #1796
Conversation
…fixed a related UX bug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, code LGTM! Thanks for fixing this. Had a couple minor suggestions.
@cchaos updated to clear the error state only when the options change, or the field is re-blurred + the input is empty |
@cchaos @cjcenizal updated to have two validation paths: first is the existing onBlur, second is when the value changes, it checks to see if there are any matching options. I found a separate issue, when the input has an exact match but additional partial match(es), the wording is incorrect:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm good with how it's working now. The only possibly odd thing is using the dropdown arrow will show the error message but it won't change the state of the input until you click outside of it.
But, I can probably live with that? The only worry would be if the consumer doesn't provide an error message. So maybe I'm back-tracking and that should be fixed as well?
but I can't come up with exact wording that I like
I'd just leave the error message as it is. It's only the docs anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Great work.
@cchaos updated to also indicate invalid state when the dropdown arrow is clicked |
Summary
Resolves #1790
Fixed a bug in determining when the focus had left EuiComboBox and added a form row with error to the Disallowing custom options example explaining to the user why the field is marked invalid.
Checklist
- [ ] This was checked in mobile- [ ] This was checked in IE11- [ ] This was checked in dark mode- [ ] Any props added have proper autodocs- [ ] Documentation examples were added- [ ] Jest tests were updated or added to match the most common scenarios- [ ] This was checked against keyboard-only and screenreader scenarios- [ ] This required updates to Framer X components