From 846f99b7bf35f323c6a76ab20c4e59224e6a622a Mon Sep 17 00:00:00 2001 From: ChenX Date: Thu, 24 Oct 2019 17:40:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=80=89=E6=8B=A9=E6=96=87?= =?UTF-8?q?=E4=BB=B6API=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Common/FileSystem.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Common/FileSystem.ts b/src/Common/FileSystem.ts index 275005362..5bc79e1af 100644 --- a/src/Common/FileSystem.ts +++ b/src/Common/FileSystem.ts @@ -358,13 +358,13 @@ export class FileSystem */ static ChooseFile({ filter, multiple = false, callback }: { filter?: string; multiple?: boolean; callback: (filelist: FileList) => void; }) { - if (!this.chooserInput) - { - this.chooserInput = document.createElement("input"); - this.chooserInput.type = "file"; - this.chooserInput.style.display = "none"; - document.body.appendChild(this.chooserInput); - } + if (this.chooserInput) + this.chooserInput.remove(); + + this.chooserInput = document.createElement("input"); + this.chooserInput.type = "file"; + this.chooserInput.style.display = "none"; + document.body.appendChild(this.chooserInput); this.chooserInput.accept = filter; this.chooserInput.onchange = () =>