Let sl-button-group deals with blur and focus handling for our Et2DropDownButton widget

This commit is contained in:
Hadi Nategh 2023-02-22 17:55:43 +01:00
parent ecd262a093
commit 24570cd438

View File

@ -189,6 +189,16 @@ export class Et2DropdownButton extends Et2widgetWithSelectMixin(Et2Button)
{
return this.shadowRoot.querySelector("sl-dropdown");
}
blur()
{
this.shadowRoot.querySelector("sl-button-group")?.dispatchEvent(new Event('blur'));
}
focus()
{
this.shadowRoot.querySelector("sl-button-group")?.dispatchEvent(new Event('focus'));
}
}
// @ts-ignore TypeScript is not recognizing that Et2Button is a LitElement