From eef8eb84327bc185778dda76c19ef1b0490bada7 Mon Sep 17 00:00:00 2001 From: nathan Date: Fri, 1 Mar 2024 09:08:55 -0700 Subject: [PATCH] Fix Et2ButtonIcon buttons using sl-icons did not show the icon --- api/js/etemplate/Et2Button/Et2ButtonIcon.ts | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/api/js/etemplate/Et2Button/Et2ButtonIcon.ts b/api/js/etemplate/Et2Button/Et2ButtonIcon.ts index 3f610b00ad..81b48293b1 100644 --- a/api/js/etemplate/Et2Button/Et2ButtonIcon.ts +++ b/api/js/etemplate/Et2Button/Et2ButtonIcon.ts @@ -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); \ No newline at end of file