Skip to content

Commit

Permalink
fix(b-form-file): ensure drag/drop handles required prop correctly (c…
Browse files Browse the repository at this point in the history
…loses #3673)
  • Loading branch information
tmorehouse committed Jul 11, 2019
1 parent 988ac2f commit d74ab11
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/components/form-file/form-file.js
Expand Up @@ -199,23 +199,26 @@ export const BFormFile = /*#__PURE__*/ Vue.extend({
this.selectedFile = this.multiple ? [] : null
},
onDragover(evt) /* istanbul ignore next: difficult to test in JSDOM */ {
evt.preventDefault()
evt.stopPropagation()
if (this.noDrop || !this.custom) {
if (this.noDrop) {
evt.preventDefault()
evt.stopPropagation()
return
}
this.dragging = true
evt.dataTransfer.dropEffect = 'copy'
},
onDragleave(evt) /* istanbul ignore next: difficult to test in JSDOM */ {
evt.preventDefault()
evt.stopPropagation()
if (this.noDrop) {
evt.preventDefault()
evt.stopPropagation()
return
}
this.dragging = false
},
onDrop(evt) /* istanbul ignore next: difficult to test in JSDOM */ {
evt.preventDefault()
evt.stopPropagation()
if (this.noDrop) {
evt.preventDefault()
evt.stopPropagation()
return
}
this.dragging = false
Expand Down

0 comments on commit d74ab11

Please sign in to comment.