SearchMixin: Fix select option not having class causes JS error

Fixes addressbook edit popup does not resize
This commit is contained in:
nathan 2023-07-27 10:04:14 -06:00
parent f56c0749b3
commit 46795ec108

View File

@ -383,7 +383,8 @@ export const Et2WithSearchMixin = <T extends Constructor<LitElement>>(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);
}