mirror of
https://github.com/konvajs/konva.git
synced 2025-09-18 09:50:05 +08:00
drag and drop logic now works correctly on mobile when both the stage is draggable and a shape
This commit is contained in:
@@ -221,9 +221,6 @@
|
||||
*/
|
||||
Kinetic.Node.prototype.isDraggable = Kinetic.Node.prototype.getDraggable;
|
||||
|
||||
// listen for capturing phase so that the _endDrag* methods are
|
||||
// called before the stage mouseup event is triggered in order
|
||||
// to render the hit graph just in time to pick up the event
|
||||
var html = document.getElementsByTagName('html')[0];
|
||||
html.addEventListener('mouseup', Kinetic.DD._endDragBefore, true);
|
||||
html.addEventListener('touchend', Kinetic.DD._endDragBefore, true);
|
||||
|
@@ -462,11 +462,9 @@
|
||||
},
|
||||
_touchstart: function(evt) {
|
||||
this._setPointerPosition(evt);
|
||||
var dd = Kinetic.DD,
|
||||
go = Kinetic.Global,
|
||||
var go = Kinetic.Global,
|
||||
obj = this.getIntersection(this.getPointerPosition()),
|
||||
shape;
|
||||
|
||||
|
||||
evt.preventDefault();
|
||||
|
||||
@@ -477,8 +475,8 @@
|
||||
shape._handleEvent(TOUCHSTART, evt);
|
||||
}
|
||||
|
||||
// init stage drag and drop
|
||||
if(dd && !go.isDragging() && this.isDraggable()) {
|
||||
//init stage drag and drop
|
||||
if(this.isDraggable() && !go.isDragReady()) {
|
||||
this.startDrag(evt);
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user