mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-18 11:58:24 +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
|
// Remove any previously selected remote options that aren't used anymore
|
||||||
this._selected_remote = this._selected_remote.filter((option) =>
|
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
|
// Remove remote options that aren't used
|
||||||
let keepers = this._selected_remote.reduce((prev, current) =>
|
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.querySelectorAll(".remote" + keepers).forEach(o => o.remove());
|
||||||
target.childNodes.forEach((n) =>
|
target.childNodes.forEach((n) =>
|
||||||
|
Loading…
Reference in New Issue
Block a user