From 782d564e7608fe8c208876ca4c7bc0f89cfc938a Mon Sep 17 00:00:00 2001
From: Matthew Shao <me@matshao.com>
Date: Fri, 12 May 2017 08:58:37 +0800
Subject: [web] Add tests for js/components/common/FileChooser.jsx & minor fix.

---
 web/src/js/components/common/FileChooser.jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'web/src/js/components/common/FileChooser.jsx')

diff --git a/web/src/js/components/common/FileChooser.jsx b/web/src/js/components/common/FileChooser.jsx
index f4607c8b..b0bf4d8d 100644
--- a/web/src/js/components/common/FileChooser.jsx
+++ b/web/src/js/components/common/FileChooser.jsx
@@ -21,7 +21,7 @@ export default function FileChooser({ icon, text, className, title, onOpenFile }
                 ref={ref => fileInput = ref}
                 className="hidden"
                 type="file"
-                onChange={e => { e.preventDefault(); if(e.target.files.length > 0) onOpenFile(e.target.files[0]); fileInput = "";}}
+                onChange={e => { e.preventDefault(); if(e.target.files.length > 0) onOpenFile(e.target.files[0])}}
             />
         </a>
     )
-- 
cgit v1.2.3


From 5c5f308a24f9d936f095277aff565e0806151778 Mon Sep 17 00:00:00 2001
From: Matthew Shao <me@matshao.com>
Date: Sat, 13 May 2017 21:01:59 +0800
Subject: [web] Minor fix for FileChooser.jsx

---
 web/src/js/components/common/FileChooser.jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'web/src/js/components/common/FileChooser.jsx')

diff --git a/web/src/js/components/common/FileChooser.jsx b/web/src/js/components/common/FileChooser.jsx
index b0bf4d8d..0b14a87e 100644
--- a/web/src/js/components/common/FileChooser.jsx
+++ b/web/src/js/components/common/FileChooser.jsx
@@ -21,7 +21,7 @@ export default function FileChooser({ icon, text, className, title, onOpenFile }
                 ref={ref => fileInput = ref}
                 className="hidden"
                 type="file"
-                onChange={e => { e.preventDefault(); if(e.target.files.length > 0) onOpenFile(e.target.files[0])}}
+                onChange={e => { e.preventDefault(); if(e.target.files.length > 0) onOpenFile(e.target.files[0]); fileInput.value="";}}
             />
         </a>
     )
-- 
cgit v1.2.3

