From 99b23236a1ea0e0fc40a44e7162416449ab3d4e0 Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Thu, 19 Jun 2025 12:42:50 +0000 Subject: [PATCH] fix: Update default button text handling and improve demo example in dees-form-submit --- ts_web/elements/dees-button.ts | 7 ++----- ts_web/elements/dees-form-submit.ts | 13 ++++++------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/ts_web/elements/dees-button.ts b/ts_web/elements/dees-button.ts index 5a0933c..6b7ccc1 100644 --- a/ts_web/elements/dees-button.ts +++ b/ts_web/elements/dees-button.ts @@ -181,7 +181,7 @@ export class DeesButton extends DeesElement { ${this.status === 'normal' ? html``: html` `} -
${this.text ? this.text : this.textContent}
+
${this.text || html`Button`}
`; } @@ -202,9 +202,6 @@ export class DeesButton extends DeesElement { } public async firstUpdated() { - if (!this.textContent) { - this.textContent = 'Button'; - this.performUpdate(); - } + // Don't set default text here as it interferes with slotted content } } diff --git a/ts_web/elements/dees-form-submit.ts b/ts_web/elements/dees-form-submit.ts index e53911e..a1e50b5 100644 --- a/ts_web/elements/dees-form-submit.ts +++ b/ts_web/elements/dees-form-submit.ts @@ -5,7 +5,6 @@ import { css, cssManager, property, - type CSSResult, } from '@design.estate/dees-element'; import { DeesForm } from './dees-form.js'; @@ -17,7 +16,7 @@ declare global { @customElement('dees-form-submit') export class DeesFormSubmit extends DeesElement { - public static demo = () => html`This is a sloted text`; + public static demo = () => html`Submit Form`; @property({ type: Boolean, @@ -38,17 +37,17 @@ export class DeesFormSubmit extends DeesElement { constructor() { super(); } - + public static styles = [cssManager.defaultStyles, css``]; public render() { return html` + ${this.text || html``} `; }