Skip to content
Snippets Groups Projects
Commit 58b6b3ce authored by Tögl, Christina's avatar Tögl, Christina
Browse files

Fix problem with slots and disabled buttons (#39)

parent 93ae7572
No related branches found
No related tags found
1 merge request!13Fix problem with slots and disabled buttons (#39)
Pipeline #14844 passed
......@@ -88,6 +88,12 @@ export class LoadingButton extends ScopedElementsMixin(LitElement) {
this.type = "";
this.loading = false;
this.disabled = false;
this.addEventListener('click', (e) => {
if (this.disabled) {
e.stopImmediatePropagation();
}
});
}
static get scopedElements() {
......@@ -155,8 +161,8 @@ export class LoadingButton extends ScopedElementsMixin(LitElement) {
render() {
return html`
<button class="button ${this.type} loading-container ${!this.loading ? "is-not-loading" : ""}" ?disabled="${this.disabled}">
<div class="label">${this.value}</div> <dbp-mini-spinner class="spinner" style="display: ${this.loading ? "inline" : "none"}"></dbp-mini-spinner>
<button class="button ${this.type} loading-container ${!this.loading ? "is-not-loading" : ""}" ?disabled="${this.disabled}">
<div class="label"><slot>${this.value}</slot></div> <dbp-mini-spinner class="spinner" style="display: ${this.loading ? "inline" : "none"}"></dbp-mini-spinner>
</button>
`;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment