From 881d3c05c53450bd32cc0aab28dfdd2dc666b985 Mon Sep 17 00:00:00 2001 From: nathan Date: Thu, 27 Jul 2023 10:04:14 -0600 Subject: [PATCH] SearchMixin: Fix select option not having class causes JS error Fixes addressbook edit popup does not resize --- api/js/etemplate/Et2Select/SearchMixin.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/js/etemplate/Et2Select/SearchMixin.ts b/api/js/etemplate/Et2Select/SearchMixin.ts index bfd0d26006..df0ff9a0f5 100644 --- a/api/js/etemplate/Et2Select/SearchMixin.ts +++ b/api/js/etemplate/Et2Select/SearchMixin.ts @@ -378,7 +378,8 @@ export const Et2WithSearchMixin = >(superclass if(changedProperties.has("value") && this.value) { // Overridden to add options if allowFreeEntries=true - if(this.allowFreeEntries && typeof this.value == "string" && !this.select_options.find(o => o.value == this.value && !o.class.includes('remote'))) + if(this.allowFreeEntries && typeof this.value == "string" && !this.select_options.find(o => o.value == this.value && + (!o.class || o.class && !o.class.includes('remote')))) { this.createFreeEntry(this.value); }