From 5a824ef25bac6ae7d41b716e7688f883a1cd59c4 Mon Sep 17 00:00:00 2001 From: nathan Date: Tue, 18 Apr 2023 10:36:34 -0600 Subject: [PATCH] Et2Select: Fix doubled tags, long tags missing ellipsis --- api/js/etemplate/Et2Select/Et2Select.ts | 18 +++++++++++------- api/js/etemplate/Et2Select/SearchMixin.ts | 2 +- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/api/js/etemplate/Et2Select/Et2Select.ts b/api/js/etemplate/Et2Select/Et2Select.ts index 01c9e1f463..14458d7292 100644 --- a/api/js/etemplate/Et2Select/Et2Select.ts +++ b/api/js/etemplate/Et2Select/Et2Select.ts @@ -83,14 +83,18 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect) /* No horizontal scrollbar, even if options are long */ .dropdown__panel { overflow-x: clip; - } - /* Ellipsis when too small */ - .select__label { + } + + /* Ellipsis when too small */ + .select_tags { + max-width: 100%; + } + .select__label { display: block; - text-overflow: ellipsis; - /* This is usually not used due to flex, but is the basis for ellipsis calculation */ - width: 10ex; - } + text-overflow: ellipsis; + /* This is usually not used due to flex, but is the basis for ellipsis calculation */ + width: 10ex; + } /** multiple=true uses tags for each value **/ /* styling for icon inside tag (not option) */ diff --git a/api/js/etemplate/Et2Select/SearchMixin.ts b/api/js/etemplate/Et2Select/SearchMixin.ts index b41c8a5567..f132bb8bde 100644 --- a/api/js/etemplate/Et2Select/SearchMixin.ts +++ b/api/js/etemplate/Et2Select/SearchMixin.ts @@ -779,7 +779,7 @@ export const Et2WithSearchMixin = >(superclass handleMenuSelect(event) { // Need to keep the remote option - only if selected - if(event.detail.item.classList.contains("remote") && !this._selected_remote.find(o => o.value == event.detail.item.value)) + if(event.detail.item.classList.contains("remote") && !this.select_options.find(o => o.value == event.detail.item.value)) { this._selected_remote.push({...event.detail.item.option}); }