File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/components/FileEditor Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ export default class FileEditor extends React.Component {
2626 componentDidMount ( ) {
2727 document . body . addEventListener ( 'click' , this . checkExternalClick ) ;
2828 document . body . addEventListener ( 'keypress' , this . handleKey ) ;
29+ let fileInputElement = document . getElementById ( 'fileInput' ) ;
30+ fileInputElement . click ( ) ;
2931 }
3032
3133 componentWillUnmount ( ) {
@@ -72,9 +74,9 @@ export default class FileEditor extends React.Component {
7274 render ( ) {
7375 const file = this . props . value ;
7476 return (
75- < div ref = 'input' style = { { minWidth : this . props . width } } className = { styles . editor } >
77+ < div ref = 'input' style = { { minWidth : this . props . width , visibility : 'hidden' } } className = { styles . editor } >
7678 < a className = { styles . upload } >
77- < input ref = 'fileInput' type = 'file' onChange = { this . handleChange . bind ( this ) } />
79+ < input ref = 'fileInput' id = "fileInput" type = 'file' onChange = { this . handleChange . bind ( this ) } />
7880 < span > { file ? 'Replace file' : 'Upload file' } </ span >
7981 </ a >
8082 </ div >
You can’t perform that action at this time.
0 commit comments