Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ var FileInput = React.createClass({
parent: {
position: 'relative'
},
// "invisible" above the text
file: {
position: 'absolute',
top: 0,
Expand All @@ -32,6 +33,7 @@ var FileInput = React.createClass({
},

render: function() {

return React.DOM.div({
style: this.state.styles.parent
},
Expand All @@ -47,8 +49,8 @@ var FileInput = React.createClass({
style: this.state.styles.file
}),

// Emulated file input
React.DOM.input({
// Emulated file input for when there are no children
this.props.children || React.DOM.input({
type: 'text',
tabIndex: -1,
name: this.props.name + '_filename',
Expand All @@ -58,7 +60,8 @@ var FileInput = React.createClass({
placeholder: this.props.placeholder,
disabled: this.props.disabled,
style: this.state.styles.text
}));
})
);
}
});

Expand Down