Add check mark to singleSelection EuiComboBox#2890
Add check mark to singleSelection EuiComboBox#2890andreadelrio merged 8 commits intoelastic:masterfrom
Conversation
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_2890/ |
|
@andreadelrio is there any chance I can convince you to wait on merging this until #2838 is in? I'd be happy to rebase this PR for you once #2838 is merged (which, could be tomorrow, maybe? It's pretty close, I think). It'll be much easier to rebase this off of #2838 than to do the reverse. |
|
@andreadelrio @dimitropoulos I agree that waiting is a good idea. We'll make sure the wait isn't long and that any conflicts are resolved for you |
| .euiFilterSelectItem__crossIcon { | ||
| visibility: hidden; // hiding cross icon in single selection combo box | ||
| } |
There was a problem hiding this comment.
@andreadelrio I'm confused by this one. Can you explain why the cross would show up in singleSelection combo boxes and why it'd be necessary to force hide it?
There was a problem hiding this comment.
Whoops, I was overcomplicating things, passing null to checked was enough. I made the changes.
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_2890/ |
|
Talked with @andreadelrio about this and the behavior is a little odd where the icon only shows on the currently focused item, not the currently selected item. She's looking into it. |
|
@cchaos pushed changes based on your PR I replaced How things are working now: |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_2890/ |
@snide thanks for catching that! Just pushed a fix. |
Ahh I didn't realize the original ternary was from this PR and not from master. 👍 |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_2890/ |
cchaos
left a comment
There was a problem hiding this comment.
Looks great! I tested (Chrome only) in all the docs examples to make sure it works with the different rendering options and it does. Much better experience for single selection. 💯
|
@andreadelrio Reminder though that we'll want to wait until the TS conversion of EuiComboBox PR #2838 gets merged first before merging this one. |
|
^ I'm going to merge the TS conversion PR shortly and then resolve any conflicts here |
| selectedOptions.length && selectedOptions[0].label === label | ||
| ? 'on' | ||
| : null; | ||
| let checked: 'on' | 'off' = 'off'; |
There was a problem hiding this comment.
@thompsongl I don't think this is correct. off would mean the icon shows a cross instead of no icon. It should be undefined or on.
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_2890/ |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_2890/ |





Summary
This PR adds a check mark to the
singleSelectioncombo box. To do this I enabledshowIconsinEuiFilterSelectItemwhensingleSelectionis true and hid the cross icon using CSS.renderOptionFixes #2808
Checklist
- [ ] Check against all themes for compatibility in both light and dark modes- [ ] Checked in mobile- [ ] Props have proper autodocs- [ ] Added documentation examples- [ ] Checked for breaking changes and labeled appropriately- [ ] Checked for accessibility including keyboard-only and screenreader modes