[web] Minor fix for FileChooser.jsx

This commit is contained in:
Matthew Shao 2017-05-13 21:01:59 +08:00
parent ace67b5a87
commit 5c5f308a24

View File

@ -21,7 +21,7 @@ export default function FileChooser({ icon, text, className, title, onOpenFile }
ref={ref => fileInput = ref} ref={ref => fileInput = ref}
className="hidden" className="hidden"
type="file" 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> </a>
) )