Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into benelan/more-linting-i…
Browse files Browse the repository at this point in the history
…mprovements

* origin/dev:
  fix(input): update files property on input event when type="file" (#11262)
  • Loading branch information
benelan committed Jan 11, 2025
2 parents a4e833d + eddf102 commit b3dd000
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions packages/calcite-components/src/components/input/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -669,16 +669,15 @@ 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;
}

if (this.type === "file") {
this.files = (this.childEl as HTMLInputElement).files;
}

this.setValue({
nativeEvent,
origin: "user",
Expand Down Expand Up @@ -1121,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}
Expand Down

0 comments on commit b3dd000

Please sign in to comment.