From 8f215a5b4bfa152100df7ea2a4327b26831ced2e Mon Sep 17 00:00:00 2001 From: A2ZH Date: Tue, 9 Apr 2019 00:33:07 +0800 Subject: [PATCH] fix select the same file bug (#538) --- src/components/intro/index.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/intro/index.tsx b/src/components/intro/index.tsx index 30fec35c..95a4eab8 100644 --- a/src/components/intro/index.tsx +++ b/src/components/intro/index.tsx @@ -53,11 +53,17 @@ export default class Intro extends Component { state: State = {}; private fileInput?: HTMLInputElement; + @bind + private resetFileInput() { + this.fileInput!.value = ""; + } + @bind private onFileChange(event: Event): void { const fileInput = event.target as HTMLInputElement; const file = fileInput.files && fileInput.files[0]; if (!file) return; + this.resetFileInput(); this.props.onFile(file); }