Skip to content

Commit

Permalink
#2 Fix DropZone consuming child events , delete is fully supported
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonatan Salas committed Aug 11, 2016
1 parent 3ccf305 commit f05d088
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/components/field/FileUpload.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,30 @@ export default class FileUpload extends Component {
this.setState({ files: files });
};

openDropZone = () => {
this.refs.dropzone.open();
};

render() {
let { files } = this.state;
let { files, disableClick } = this.state;

const attachmentStyle = {
marginTop: "6px",
color: "#616161"
};

const messageContainerStyle = {
marginTop: "6px"
marginTop: "10px"
};

const messageStyle = {
textAlign: "center",
color: "#616161"
};

let rowStyle = {};
let rowStyle = {
padding: "0px"
};

if (files) {
rowStyle = {
Expand All @@ -80,10 +86,10 @@ export default class FileUpload extends Component {
</div>
</Col>
<Col xs={10} md={10}>
<DropZone onDrop={this.onDrop}>
<DropZone ref="dropzone" onDrop={this.onDrop} disableClick>
<div style={messageContainerStyle}>
<p style={messageStyle}>
<Glyphicon glyph="cloud-upload"/> Drop files to attach, or <a>browse</a>
<Glyphicon glyph="cloud-upload"/> Drop files to attach, or <a onClick={this.openDropZone}>browse</a>
</p>
</div>
<div style={rowStyle}>
Expand Down

0 comments on commit f05d088

Please sign in to comment.