From 593640edd73cd07799c919dc607ca08b1fd6644f Mon Sep 17 00:00:00 2001 From: ralf Date: Mon, 22 May 2023 07:54:03 +0200 Subject: [PATCH] Revert "Et2Select: If the value contains something that does not pass validation, show it as an invalid tag so it can be removed." Stalls calendar :( This reverts commit 94d43a0a28043bb8d0f1557b70027eece5dc0687. --- api/js/etemplate/Et2Select/Et2Select.ts | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/api/js/etemplate/Et2Select/Et2Select.ts b/api/js/etemplate/Et2Select/Et2Select.ts index 26129ec1bb..bc0af1c789 100644 --- a/api/js/etemplate/Et2Select/Et2Select.ts +++ b/api/js/etemplate/Et2Select/Et2Select.ts @@ -628,25 +628,6 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect) const checkedItems = Object.values(this._menuItems).filter(item => this.value.includes(item.value)); this.displayTags = checkedItems.map(item => this._createTagNode(item)); - if(checkedItems.length !== this.value.length && this.multiple) - { - // There's a value that does not have a menu item, probably invalid. - // Add it as a marked tag so it can be corrected or removed. - const filteredValues = this.value.filter(str => !checkedItems.some(obj => obj.value === str)); - for(let i = 0; i < filteredValues.length; i++) - { - const badTag = this._createTagNode({ - value: filteredValues[i], - getTextLabel: () => filteredValues[i], - classList: {value: ""} - }); - badTag.variant = "danger"; - badTag.contactPlus = false; - // Put it in front so it shows - this.displayTags.unshift(badTag); - } - } - // Re-slice & add overflow tag if(overflow) { @@ -785,7 +766,6 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect) this.dispatchEvent(new CustomEvent('sl-input')); this.dispatchEvent(new CustomEvent('sl-change')); this.syncItemsFromValue(); - this.validate(); } }