Fix Et2ButtonIcon buttons using sl-icons did not show the icon

This commit is contained in:
nathan 2024-03-01 09:08:55 -07:00
parent 559099ee05
commit eef8eb8432

View File

@ -45,7 +45,8 @@ export class Et2ButtonIcon extends ButtonMixin(Et2InputWidget(SlIconButton))
}
if(new_image && !this.src)
{
this.__name = new_image;
// For some reason setting it directly does not show the image
this.updateComplete.then(() => this.name = new_image);
}
}
@ -53,16 +54,6 @@ export class Et2ButtonIcon extends ButtonMixin(Et2InputWidget(SlIconButton))
{
return this.src || this.name;
}
set name(name)
{
// No - use image to avoid conflicts between our icons & SlIconButton's image/url loading
}
get name()
{
return super.name;
}
}
customElements.define("et2-button-icon", Et2ButtonIcon);