mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-03 21:35:20 +01:00
Et2Select: Not showing new freeEntry in select options immediately after adding it
This commit is contained in:
parent
7195ea09b2
commit
8f4c9cbb0a
@ -672,7 +672,7 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect)
|
|||||||
{
|
{
|
||||||
return html`${repeat(this.select_options
|
return html`${repeat(this.select_options
|
||||||
// Filter out empty values if we have empty label to avoid duplicates
|
// Filter out empty values if we have empty label to avoid duplicates
|
||||||
.filter(o => this.emptyLabel ? o.value !== '' : o), o => o.value, this._groupTemplate.bind(this))
|
.filter(o => this.emptyLabel ? o.value !== '' : o), (o : SelectOption) => o.value, this._groupTemplate.bind(this))
|
||||||
}`;
|
}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -705,7 +705,7 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect)
|
|||||||
title="${!option.title || this.noLang ? option.title : this.egw().lang(option.title)}"
|
title="${!option.title || this.noLang ? option.title : this.egw().lang(option.title)}"
|
||||||
class=${classMap({
|
class=${classMap({
|
||||||
"match": this.searchEnabled && (option.isMatch || false),
|
"match": this.searchEnabled && (option.isMatch || false),
|
||||||
"no-match": this.searchEnabled && !(option.isMatch || false),
|
"no-match": this.searchEnabled && option.isMatch == false,
|
||||||
...classes
|
...classes
|
||||||
})}
|
})}
|
||||||
.option=${option}
|
.option=${option}
|
||||||
|
@ -195,7 +195,7 @@ export const Et2WithSearchMixin = dedupeMixin(<T extends Constructor<LitElement>
|
|||||||
|
|
||||||
/* Hide options that do not match current search text */
|
/* Hide options that do not match current search text */
|
||||||
|
|
||||||
[searching] .no-match {
|
:host([search]) sl-option.no-match {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
/* Different cursor for editable tags */
|
/* Different cursor for editable tags */
|
||||||
@ -1155,6 +1155,13 @@ export const Et2WithSearchMixin = dedupeMixin(<T extends Constructor<LitElement>
|
|||||||
}
|
}
|
||||||
this.select_options.map(clear_flag);
|
this.select_options.map(clear_flag);
|
||||||
this.requestUpdate("select_options");
|
this.requestUpdate("select_options");
|
||||||
|
|
||||||
|
// Rendering options using repeat() means we need to explicitly update the nodes since they
|
||||||
|
// don't always get re-rendered
|
||||||
|
for(const option of this.select.querySelectorAll(".no-match"))
|
||||||
|
{
|
||||||
|
option.classList.remove("no-match", "match");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1393,7 +1400,8 @@ export const Et2WithSearchMixin = dedupeMixin(<T extends Constructor<LitElement>
|
|||||||
this.__select_options.push(<SelectOption>{
|
this.__select_options.push(<SelectOption>{
|
||||||
value: text.trim(),
|
value: text.trim(),
|
||||||
label: text.trim(),
|
label: text.trim(),
|
||||||
class: "freeEntry"
|
class: "freeEntry",
|
||||||
|
isMatch: false
|
||||||
});
|
});
|
||||||
this.requestUpdate('select_options');
|
this.requestUpdate('select_options');
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user