mirror of
https://github.com/konvajs/konva.git
synced 2025-05-17 05:59:35 +08:00
added defensive coding to _handleEvent() method which fixes a bug related to canceling stage drag and drop while dragging
This commit is contained in:
parent
9c1f32d341
commit
257497755b
@ -896,7 +896,7 @@ Kinetic.Node.prototype = {
|
|||||||
* handle node event
|
* handle node event
|
||||||
*/
|
*/
|
||||||
_handleEvent: function(eventType, evt, compareShape) {
|
_handleEvent: function(eventType, evt, compareShape) {
|
||||||
if(this.nodeType === 'Shape') {
|
if(evt && this.nodeType === 'Shape') {
|
||||||
evt.shape = this;
|
evt.shape = this;
|
||||||
}
|
}
|
||||||
var stage = this.getStage();
|
var stage = this.getStage();
|
||||||
@ -916,7 +916,7 @@ Kinetic.Node.prototype = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// simulate event bubbling
|
// simulate event bubbling
|
||||||
if(!evt.cancelBubble && this.parent) {
|
if(evt && !evt.cancelBubble && this.parent) {
|
||||||
if(compareShape && compareShape.parent) {
|
if(compareShape && compareShape.parent) {
|
||||||
this._handleEvent.call(this.parent, eventType, evt, compareShape.parent);
|
this._handleEvent.call(this.parent, eventType, evt, compareShape.parent);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user