diff --git a/src/components/input/input.component.ts b/src/components/input/input.component.ts index 44c9b0df..6a17cbf5 100644 --- a/src/components/input/input.component.ts +++ b/src/components/input/input.component.ts @@ -407,7 +407,9 @@ export default class SlInput extends ShoelaceElement implements ShoelaceFormCont const hasLabel = this.label ? true : !!hasLabelSlot; const hasHelpText = this.helpText ? true : !!hasHelpTextSlot; const hasClearIcon = - this.clearable && !this.disabled && !this.readonly && (typeof this.value === 'number' || this.value.length > 0); + this.clearable && !this.disabled && !this.readonly; + const hasClearIconVisible = + hasClearIcon && (typeof this.value === 'number' || this.value.length > 0); return html`