From daaf15df3754c2f8d2eb21fe37841800eeebc5ff Mon Sep 17 00:00:00 2001 From: Ben Elan Date: Fri, 10 Jan 2025 13:08:34 -0800 Subject: [PATCH 1/2] fix(input): update files property on input event when type="file" --- packages/calcite-components/src/components/input/input.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/calcite-components/src/components/input/input.tsx b/packages/calcite-components/src/components/input/input.tsx index c07b17afe45..84ec0bfc621 100644 --- a/packages/calcite-components/src/components/input/input.tsx +++ b/packages/calcite-components/src/components/input/input.tsx @@ -679,6 +679,11 @@ export class Input if (this.disabled || this.readOnly) { return; } + + if (this.type === "file") { + this.files = (this.childEl as HTMLInputElement).files; + } + this.setValue({ nativeEvent, origin: "user", From a53c948fd68ded6c9c737d853a26b3b1cb2c1cc3 Mon Sep 17 00:00:00 2001 From: Ben Elan Date: Fri, 10 Jan 2025 16:11:21 -0800 Subject: [PATCH 2/2] chore: remove change handler --- packages/calcite-components/src/components/input/input.tsx | 7 ------- 1 file changed, 7 deletions(-) diff --git a/packages/calcite-components/src/components/input/input.tsx b/packages/calcite-components/src/components/input/input.tsx index 84ec0bfc621..368be7c51a6 100644 --- a/packages/calcite-components/src/components/input/input.tsx +++ b/packages/calcite-components/src/components/input/input.tsx @@ -669,12 +669,6 @@ export class Input this.calciteInternalInputFocus.emit(); } - private inputChangeHandler(): void { - if (this.type === "file") { - this.files = (this.childEl as HTMLInputElement).files; - } - } - private inputInputHandler(nativeEvent: InputEvent): void { if (this.disabled || this.readOnly) { return; @@ -1126,7 +1120,6 @@ export class Input multiple={this.multiple} name={this.name} onBlur={this.inputBlurHandler} - onChange={this.inputChangeHandler} onFocus={this.inputFocusHandler} onInput={this.inputInputHandler} onKeyDown={this.inputKeyDownHandler}