ET2Button doesn't get resized properly after set/remove label therefore try to force an update

This commit is contained in:
Hadi Nategh 2023-02-16 15:17:13 +01:00
parent 32392ea0e3
commit b25346c1e4

View File

@ -52,10 +52,16 @@ export class Et2Button extends ButtonMixin(Et2InputWidget(SlButton))
{
const textNode = document.createTextNode(new_label);
this.appendChild(textNode);
// for some reason button doesn't get resized properly without a forced rendereing therefore the
// requestUpdate is used to trigger a refresh.
this.requestUpdate();
}
else
{
this._labelNode.textContent = new_label;
// for some reason button doesn't get resized properly without a forced rendereingtherefore the
// requestUpdate is used to trigger a refresh.
this.requestUpdate();
}
});
}