mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 06:30:59 +01:00
SearchMixin: Filter selected remote correctly for single selects too
This commit is contained in:
parent
513b1dd4f8
commit
6177ca0536
@ -986,12 +986,12 @@ export const Et2WithSearchMixin = <T extends Constructor<LitElement>>(superclass
|
||||
// Remove any previously selected remote options that aren't used anymore
|
||||
this._selected_remote = this._selected_remote.filter((option) =>
|
||||
{
|
||||
return this.value.indexOf(option.value) != -1;
|
||||
return this.multiple ? this.value.indexOf(option.value) != -1 : this.value == option.value;
|
||||
});
|
||||
// Remove remote options that aren't used
|
||||
let keepers = this._selected_remote.reduce((prev, current) =>
|
||||
{
|
||||
return prev + ":not([value='" + current.value.replace(/'/g, "\\\'") + "'])";
|
||||
return prev + ":not([value='" + ('' + current.value).replace(/'/g, "\\\'") + "'])";
|
||||
}, "");
|
||||
target.querySelectorAll(".remote" + keepers).forEach(o => o.remove());
|
||||
target.childNodes.forEach((n) =>
|
||||
|
Loading…
Reference in New Issue
Block a user