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 {
26
26
componentDidMount ( ) {
27
27
document . body . addEventListener ( 'click' , this . checkExternalClick ) ;
28
28
document . body . addEventListener ( 'keypress' , this . handleKey ) ;
29
+ let fileInputElement = document . getElementById ( 'fileInput' ) ;
30
+ fileInputElement . click ( ) ;
29
31
}
30
32
31
33
componentWillUnmount ( ) {
@@ -72,9 +74,9 @@ export default class FileEditor extends React.Component {
72
74
render ( ) {
73
75
const file = this . props . value ;
74
76
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 } >
76
78
< 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 ) } />
78
80
< span > { file ? 'Replace file' : 'Upload file' } </ span >
79
81
</ a >
80
82
</ div >
You can’t perform that action at this time.
0 commit comments