From a9b9a045a6fd357dba98cb13e4ad7782a16a3843 Mon Sep 17 00:00:00 2001 From: Ben Elan Date: Wed, 11 Jan 2023 19:39:07 -0800 Subject: [PATCH] feat(input): add files property --- src/components/input/input.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/components/input/input.tsx b/src/components/input/input.tsx index 0048733a2fe..dda7d69ba55 100644 --- a/src/components/input/input.tsx +++ b/src/components/input/input.tsx @@ -325,6 +325,13 @@ export class Input /** The component's value. */ @Prop({ mutable: true }) value = ""; + /** + * Contains the component's list of files when `type` is `"file"`. + * + * @mdn https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/files + */ + @Prop({ mutable: true }) files: FileList; + /** * Made into a prop for testing purposes only * @@ -344,6 +351,10 @@ export class Input @Watch("value") valueWatcher(newValue: string, previousValue: string): void { + if (this.type === "file") { + this.files = (this.childEl as HTMLInputElement).files; + } + if (!this.userChangedValue) { this.setValue({ origin: "direct",