diff --git a/src/interaction/InteractionManager.js b/src/interaction/InteractionManager.js index 8d51082..67e09f6 100644 --- a/src/interaction/InteractionManager.js +++ b/src/interaction/InteractionManager.js @@ -1098,7 +1098,7 @@ const test = isRightButton ? flags.RIGHT_DOWN : flags.LEFT_DOWN; - const isDown = trackingData !== undefined && (trackingData.flags | test); + const isDown = trackingData !== undefined && (trackingData.flags & test); if (hit) { diff --git a/src/interaction/InteractionManager.js b/src/interaction/InteractionManager.js index 8d51082..67e09f6 100644 --- a/src/interaction/InteractionManager.js +++ b/src/interaction/InteractionManager.js @@ -1098,7 +1098,7 @@ const test = isRightButton ? flags.RIGHT_DOWN : flags.LEFT_DOWN; - const isDown = trackingData !== undefined && (trackingData.flags | test); + const isDown = trackingData !== undefined && (trackingData.flags & test); if (hit) { diff --git a/test/interaction/InteractionManager.js b/test/interaction/InteractionManager.js index d35c398..dc70ab5 100644 --- a/test/interaction/InteractionManager.js +++ b/test/interaction/InteractionManager.js @@ -326,6 +326,24 @@ expect(clickSpy).to.not.have.been.called; }); + + it('should not call handler when mousedown not received', function () + { + const stage = new PIXI.Container(); + const graphics = new PIXI.Graphics(); + const clickSpy = sinon.spy(); + const pointer = new MockPointer(stage); + + stage.addChild(graphics); + graphics.beginFill(0xFFFFFF); + graphics.drawRect(0, 0, 50, 50); + graphics.interactive = true; + graphics.on('click', clickSpy); + + pointer.mouseup(10, 10); + + expect(clickSpy).to.not.have.been.called; + }); }); describe('onTap', function ()