diff --git a/api/js/etemplate/Et2Button/Et2Button.ts b/api/js/etemplate/Et2Button/Et2Button.ts index 983a652b8f..afb66267c5 100644 --- a/api/js/etemplate/Et2Button/Et2Button.ts +++ b/api/js/etemplate/Et2Button/Et2Button.ts @@ -11,6 +11,7 @@ import {css} from "@lion/core"; import {Et2InputWidget} from "../Et2InputWidget/Et2InputWidget"; +import '../Et2Image/Et2Image'; import {SlButton} from "@shoelace-style/shoelace"; import shoelace from "../Styles/shoelace"; @@ -70,7 +71,7 @@ export class Et2Button extends Et2InputWidget(SlButton) width: 16px !important; } ::slotted(et2-image) { - width: 20px; + max-width: 20px; display: flex; } ::slotted([slot="icon"][src='']) { diff --git a/api/js/etemplate/Et2Image/Et2Image.ts b/api/js/etemplate/Et2Image/Et2Image.ts index 7b1df2e64b..b60c0a4408 100644 --- a/api/js/etemplate/Et2Image/Et2Image.ts +++ b/api/js/etemplate/Et2Image/Et2Image.ts @@ -9,7 +9,7 @@ */ -import {css, html, LitElement, SlotMixin} from "@lion/core"; +import {css, html, LitElement, render, SlotMixin} from "@lion/core"; import {Et2Widget} from "../Et2Widget/Et2Widget"; import {et2_IDetachedDOM} from "../et2_core_interfaces"; @@ -171,6 +171,10 @@ export class Et2Image extends Et2Widget(SlotMixin(LitElement)) implements et2_ID { super.updated(changedProperties); + if(changedProperties.has("src") && !this._img) + { + render(this._imageTemplate(), this); + } if(changedProperties.has("src") && this._img) { this._img.setAttribute("src", this.parse_href(this.src) || this.parse_href(this.defaultSrc));