Skip to content

EuiComboBox with single selection and custom option should not show a list#1882

Merged
thompsongl merged 4 commits into
elastic:masterfrom
thompsongl:1872-combobox-single-custom
Apr 25, 2019
Merged

EuiComboBox with single selection and custom option should not show a list#1882
thompsongl merged 4 commits into
elastic:masterfrom
thompsongl:1872-combobox-single-custom

Conversation

@thompsongl
Copy link
Copy Markdown
Contributor

@thompsongl thompsongl commented Apr 24, 2019

Summary

Fixes #1872, in which an EuiComboBox with singleSelection and onAddCustomOption re-opens the options list after adding a custom option even though no more selections can be made.

If the custom option does not show in the options list, the user now must clear the search/selection before the options list will open.

@cchaos, let me know if I need to adjust experience further to get at what you intended

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

  • A changelog entry exists and is marked appropriately

- [ ] This was checked for breaking changes and labeled appropriately
- [ ] 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

@chandlerprall
Copy link
Copy Markdown
Contributor

I'll code review after Caroline has done a UX pass.

@cchaos
Copy link
Copy Markdown
Contributor

cchaos commented Apr 24, 2019

Can/Should we also disabled the dropdown arrow button? Seems like it's a bit misleading that clicking the arrow no longer does anything. The alternative would be to allow forcing the dropdown to show when clicking the arrow, but not when just entering into the input. The latter may be more ideal but also more complicated.

@thompsongl
Copy link
Copy Markdown
Contributor Author

@cchaos Seems reasonable. I'll try the 2nd option.

@thompsongl
Copy link
Copy Markdown
Contributor Author

Updated to have the arrow button open the list regardless of single selection custom option state

Copy link
Copy Markdown
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

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

WFM! TY!

One thing I did notice is that in FF, combo box dropdowns won't close when the arrow is clicked.

Might be related to #1385

Don't forget a CL, and maybe a test would be helpful.

@thompsongl
Copy link
Copy Markdown
Contributor Author

^ That's been a thing in FireFox, I guess (reproducable in the prod docs).

Specifically, it has to do with the focusout event listener and its relatedTarget value, which may or may not be what #1385 is getting at. I'll look a bit more, but likely will open a new issue for what you see.

@thompsongl
Copy link
Copy Markdown
Contributor Author

Updated CL and created #1885 to fix the Firefox issue @cchaos saw (new PR as it may require additional discussion not related to this diff)

Copy link
Copy Markdown
Contributor

@chandlerprall chandlerprall left a comment

Choose a reason for hiding this comment

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

changes LGTM, pulled & tested docs locally

@thompsongl thompsongl merged commit 35f9bf0 into elastic:master Apr 25, 2019
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.

EuiComboBox single select with custom allowed should not re-open dropdown

3 participants