Et2Select: Fix overflow / row limit

This commit is contained in:
nathan 2023-11-21 14:54:14 -07:00
parent a17cbe1f45
commit 3fd2cacf57

View File

@ -93,7 +93,8 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect)
} }
/* Ellipsis when too small */ /* Ellipsis when too small */
.select__tags {
::part(tags) {
max-width: 100%; max-width: 100%;
} }
.select__label { .select__label {
@ -112,29 +113,24 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect)
/* Maximum height + scrollbar on tags (+ other styling) */ /* Maximum height + scrollbar on tags (+ other styling) */
.select__tags { ::part(tags) {
margin-left: 0px; margin-left: 0px;
max-height: initial; max-height: initial;
overflow-y: auto; overflow-y: auto;
gap: 0.1rem 0.5rem; gap: 0.1rem 0.5rem;
} }
.select--medium .select__tags { :host([rows]) ::part(tags) {
padding-top: 2px; max-height: calc(var(--rows, 5) * 2.3em);
padding-bottom: 2px;
} }
:host([rows]) .select__control > .select__label > .select__tags { :host([rows='1']) ::part(tags) {
max-height: calc(var(--rows, 5) * 29px);
}
:host([rows='1']) .select__tags {
overflow: hidden; overflow: hidden;
} }
/* Keep overflow tag right-aligned. It's the only sl-tag. */ /* Keep overflow tag right-aligned. It's the only sl-tag. */
.select__tags sl-tag { ::part(tags) sl-tag {
margin-left: auto; margin-left: auto;
} }