From 23840fbf52c4b5eb6741d3e7758e1ad4c1024e8d Mon Sep 17 00:00:00 2001 From: IgnacioBecerra Date: Wed, 17 Jan 2024 07:52:43 -0800 Subject: [PATCH 1/2] fix(input): display default value properly --- .../carbon-web-components/src/components/input/input.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/carbon-web-components/src/components/input/input.ts b/packages/carbon-web-components/src/components/input/input.ts index a7d932272ad..269bae841b9 100644 --- a/packages/carbon-web-components/src/components/input/input.ts +++ b/packages/carbon-web-components/src/components/input/input.ts @@ -44,11 +44,6 @@ export default class BXInput extends ValidityMixin(FormMixin(LitElement)) { @query('input') protected _input!: HTMLInputElement; - /** - * The internal value. - */ - protected _value = ''; - /** * Set initial value of input */ @@ -301,7 +296,7 @@ export default class BXInput extends ValidityMixin(FormMixin(LitElement)) { ?readonly="${this.readonly}" ?required="${this.required}" type="${ifNonEmpty(this.type)}" - .value="${this._value}" + .value="${this.value}" @input="${handleInput}" /> ${this.showPasswordVisibilityToggle && (this.type === INPUT_TYPE.PASSWORD || this.type === INPUT_TYPE.TEXT) From e55e986146cbc8b9c30997536e81bf851da60cb5 Mon Sep 17 00:00:00 2001 From: IgnacioBecerra Date: Wed, 17 Jan 2024 14:29:42 -0800 Subject: [PATCH 2/2] fix(number-input): update value --- .../src/components/number-input/number-input.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/carbon-web-components/src/components/number-input/number-input.ts b/packages/carbon-web-components/src/components/number-input/number-input.ts index 6e0d953354b..d028571cacb 100644 --- a/packages/carbon-web-components/src/components/number-input/number-input.ts +++ b/packages/carbon-web-components/src/components/number-input/number-input.ts @@ -316,7 +316,7 @@ export default class BXNumberInput extends BXInput { ?readonly="${this.readonly}" ?required="${this.required}" type="number" - .value="${this._value}" + .value="${this.value}" @input="${handleInput}" min="${ifNonEmpty(this.min)}" max="${ifNonEmpty(this.max)}"