EgwMenuShoelace bugfixes

- Fix menu does not do action
- Fix menus accumulate in DOM
This commit is contained in:
nathan 2024-06-17 09:26:10 -06:00
parent 5770484723
commit ba3aa1c4b5

View File

@ -103,6 +103,9 @@ export class EgwMenuShoelace extends LitElement
public hide() public hide()
{ {
this.popup.active = false; this.popup.active = false;
// egw_menu always creates a new menu
this.remove();
} }
handleSelect(event) handleSelect(event)
@ -115,7 +118,7 @@ export class EgwMenuShoelace extends LitElement
if(event.detail.item.value) if(event.detail.item.value)
{ {
const item = <egwMenuItem>event.detail.item.value; const item = <egwMenuItem>event.detail.item.value;
if(item.checkbox || typeof item.checked !== "undefined") if(item.checkbox)
{ {
item.checked = event.detail.item.checked; item.checked = event.detail.item.checked;
return; return;