File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ var FileInput = React.createClass({
8
8
parent : {
9
9
position : 'relative'
10
10
} ,
11
+ // "invisible" above the text
11
12
file : {
12
13
position : 'absolute' ,
13
14
top : 0 ,
@@ -32,6 +33,7 @@ var FileInput = React.createClass({
32
33
} ,
33
34
34
35
render : function ( ) {
36
+
35
37
return React . DOM . div ( {
36
38
style : this . state . styles . parent
37
39
} ,
@@ -47,8 +49,8 @@ var FileInput = React.createClass({
47
49
style : this . state . styles . file
48
50
} ) ,
49
51
50
- // Emulated file input
51
- React . DOM . input ( {
52
+ // Emulated file input for when there are no children
53
+ this . props . children || React . DOM . input ( {
52
54
type : 'text' ,
53
55
tabIndex : - 1 ,
54
56
name : this . props . name + '_filename' ,
@@ -58,7 +60,8 @@ var FileInput = React.createClass({
58
60
placeholder : this . props . placeholder ,
59
61
disabled : this . props . disabled ,
60
62
style : this . state . styles . text
61
- } ) ) ;
63
+ } )
64
+ ) ;
62
65
}
63
66
} ) ;
64
67
You can’t perform that action at this time.
0 commit comments