Skip to content

Commit

Permalink
Fixed buggy file upload container (#1841)
Browse files Browse the repository at this point in the history
Co-authored-by: Jeffrey Warren <jeff@unterbahn.com>
  • Loading branch information
waridrox and jywarren committed Mar 12, 2021
1 parent 5298d1e commit 417c1b1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion examples/demo.css
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ body > .container-fluid {
}

.hover {
background: #eee;
border: 4px dashed #888888;
background: #F0F0F0;
}

.step {
Expand Down
11 changes: 8 additions & 3 deletions src/ui/SetInputStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ function setInputStepInit() {
dropzone[0].addEventListener('drop', handleFile, false);

dropzone.on('dragover', function onDragover(e) {
e.stopPropagation();
dropzone.addClass('hover');
e.preventDefault();
e.dataTransfer.dropEffect = 'copy'; // Explicitly show this is a copy.
}, false);
e.stopPropagation();
});

dropzone.on('dragenter', function onDragEnter(e) {
dropzone.addClass('hover');
Expand All @@ -127,6 +127,11 @@ function setInputStepInit() {
dropzone.removeClass('hover');
});

dropzone.on('drop', function onDrop(e) {
dropzone.removeClass('hover');
e.preventDefault();
});

};

}
Expand Down

0 comments on commit 417c1b1

Please sign in to comment.