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
13 changes: 11 additions & 2 deletions src/components/vue-draggable-resizable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ export default {
handle: null,
enabled: this.active,
resizing: false,
clicking: false,
dragging: false,
dragEnable: false,
resizeEnable: false,
Expand Down Expand Up @@ -395,6 +396,8 @@ export default {
this.mouseClickPosition.top = this.top
this.mouseClickPosition.bottom = this.bottom

this.clicking = true

if (this.parent) {
this.bounds = this.calcDragLimits()
}
Expand All @@ -418,7 +421,7 @@ export default {
deselect (e) {
const target = e.target || e.srcElement
const regex = new RegExp(this.className + '-([trmbl]{2})', '')

if (!this.$el.contains(target) && !regex.test(target.className)) {
if (this.enabled && !this.preventDeactivation) {
this.enabled = false
Expand All @@ -430,7 +433,7 @@ export default {
removeEvent(document.documentElement, eventsFor.move, this.handleResize)
}

this.resetBoundsAndMouseState()
!this.clicking && this.resetBoundsAndMouseState()
},
handleTouchDown (handle, e) {
eventsFor = events.touch
Expand Down Expand Up @@ -467,6 +470,8 @@ export default {

this.bounds = this.calcResizeLimits()

this.clicking = true

addEvent(document.documentElement, eventsFor.move, this.handleResize)
addEvent(document.documentElement, eventsFor.stop, this.handleUp)
},
Expand Down Expand Up @@ -773,6 +778,10 @@ export default {
this.$emit('dragStop', this.left, this.top)
}

if (this.clicking) {
this.clicking = false
}

removeEvent(document.documentElement, eventsFor.move, this.handleResize)
}
},
Expand Down