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