forked from extern/egroupware
Fix changing select options did not properly clear previous options
This commit is contained in:
parent
01a08447cb
commit
8514792efc
@ -153,14 +153,10 @@ export const Et2widgetWithSelectMixin = <T extends Constructor<LitElement>>(supe
|
|||||||
return Promise.all(([...temp_target.querySelectorAll(":scope > *")].map(item => item.render)))
|
return Promise.all(([...temp_target.querySelectorAll(":scope > *")].map(item => item.render)))
|
||||||
.then(() =>
|
.then(() =>
|
||||||
{
|
{
|
||||||
temp_target.querySelectorAll(":scope > *").forEach((item) =>
|
this._optionTargetNode.replaceChildren(
|
||||||
{
|
...Array.from(temp_target.querySelectorAll(":scope > *")),
|
||||||
// Avoid duplicate error
|
...Array.from(this._optionTargetNode.querySelectorAll(":scope > [slot]"))
|
||||||
if(!this._optionTargetNode.querySelector("[value='" + item.value.replace(/'/g, '\\\'') + "']"))
|
);
|
||||||
{
|
|
||||||
this._optionTargetNode.appendChild(item);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if(typeof this.handleMenuSlotChange == "function")
|
if(typeof this.handleMenuSlotChange == "function")
|
||||||
{
|
{
|
||||||
this.handleMenuSlotChange();
|
this.handleMenuSlotChange();
|
||||||
|
Loading…
Reference in New Issue
Block a user