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

Multi-Select Combo Box: Color-Coded Chips #6593

Closed
anezthes opened this issue Oct 4, 2023 · 4 comments · Fixed by #7305
Closed

Multi-Select Combo Box: Color-Coded Chips #6593

anezthes opened this issue Oct 4, 2023 · 4 comments · Fixed by #7305
Assignees
Labels
enhancement New feature or request vaadin-multi-select-combo-box workaround There is a workaround in the comments.

Comments

@anezthes
Copy link
Contributor

anezthes commented Oct 4, 2023

Describe your motivation

Client would like to color code the chips. Now, why would you want to color code the chips? Well, here's my good friend Chad Geepieteh to answer that for you:

"Color coding in lists of options offers numerous benefits, including improved visual clarity, faster decision-making, reduced errors, and enhanced user experience. When implemented thoughtfully and with consideration for accessibility, it can be a valuable tool for both usability and aesthetics in various applications and interfaces."

Describe the solution you'd like

Some kind of chip renderer perhaps? Any way of adding class names to individual chips would be great.

@TatuLund
Copy link
Contributor

TatuLund commented Oct 5, 2023

Currently you can do this in some cases using title attribute in the CSS selector, but this is cumbersome when localization of the item labels are needed. As the chips are in light DOM, it would be sufficient if we would have setClassNameGenerator(..) in Multi-Select Combo Box

@TatuLund TatuLund added the workaround There is a workaround in the comments. label Oct 6, 2023
@rolfsmeds
Copy link
Contributor

It would probably make sense to introduce a ClassNameGenerator for the items that would apply the classname both to the chips and the corresponding items in the dropdown.

@web-padawan
Copy link
Member

Prototype: https://github.com/vaadin/web-components/compare/proto-chip-class-name-generator

Using chipClassNameGenerator function for chips is quite easy. If we also need that to be applied to items, then it would require also updating vaadin-combo-box scroller and would probably better to be named itemClassNameGenerator.

@rolfsmeds
Copy link
Contributor

Acceptance Criteria: vaadin/platform#5212

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request vaadin-multi-select-combo-box workaround There is a workaround in the comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants