mirror of
https://github.com/konvajs/konva.git
synced 2025-08-20 09:24:08 +08:00
Merge branch 'progfay-stage-pointerleave'
This commit is contained in:
commit
2a60b6a97c
@ -58,6 +58,7 @@ const STAGE = 'Stage',
|
||||
[POINTERMOVE, '_pointermove'],
|
||||
[POINTERUP, '_pointerup'],
|
||||
[POINTERCANCEL, '_pointercancel'],
|
||||
[POINTERLEAVE, '_pointerleave'],
|
||||
[LOSTPOINTERCAPTURE, '_lostpointercapture'],
|
||||
];
|
||||
|
||||
|
||||
@ -1223,6 +1223,19 @@ describe('Stage', function () {
|
||||
assert.equal(count, 2);
|
||||
});
|
||||
|
||||
it('stage pointerleave should fire when leaving stage', function () {
|
||||
var stage = addStage();
|
||||
|
||||
var stageLeave = 0;
|
||||
stage.on('pointerleave', function () {
|
||||
stageLeave += 1;
|
||||
});
|
||||
|
||||
stage.fire('pointerleave', undefined, false);
|
||||
|
||||
assert.equal(stageLeave, 1, 'stage pointerleave should fire');
|
||||
});
|
||||
|
||||
it('stage pointerleave should not fire when leaving a child', function () {
|
||||
var stage = addStage();
|
||||
var layer = new Konva.Layer();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user