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

feat: add option to always show all chips for selected items #6515

Merged
merged 2 commits into from
Oct 25, 2023

Conversation

web-padawan
Copy link
Member

Description

Related to #4625

Screenshot 2023-09-20 at 15 55 45

The look and feel is inspired by the original Multi Select Combo Box addon.

Type of change

  • Prototype

Note

This PR is a draft, it lacks unit tests and API design (we need to decide how the property should be named)

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@@ -45,6 +45,14 @@ const multiSelectComboBox = css`
flex-basis: 0;
padding: 0;
}

:host([all-chips-visible]) #chips {
display: contents;
Copy link
Member Author

Choose a reason for hiding this comment

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

This is needed to get <input> element wrapping together with chip elements. In case of Goran's addon, it worked out of the box because there wasn't any additional container around chip elements.

}

:host([all-chips-visible]) [class$='container'] {
width: fit-content;
Copy link
Member Author

Choose a reason for hiding this comment

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

This ensures the component expands when selecting a new item, until max-width is reached.

::slotted([slot='chip']:not([readonly]):not([disabled])) {
padding-inline-end: 0;
}

:host([all-chips-visible]) ::slotted([slot='input']) {
min-height: calc(var(--lumo-text-field-size, var(--lumo-size-m)) - 2 * var(--lumo-space-xs));
Copy link
Member Author

Choose a reason for hiding this comment

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

Reduced min-height to align input more nicely when chips wrap into multiple lines.

@web-padawan web-padawan force-pushed the feat/mscb-all-chips-visible branch from 979d0b3 to e3192ee Compare October 25, 2023 09:10
@web-padawan web-padawan marked this pull request as ready for review October 25, 2023 09:10
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 24.3.0.alpha1 and is also targeting the upcoming stable 24.3.0 version.

@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 23.4.0.

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

Successfully merging this pull request may close these issues.

3 participants