Merge branch 'progfay-stage-pointerleave'

This commit is contained in:
Anton Lavrevov 2025-07-07 09:58:06 -05:00
commit 2a60b6a97c
2 changed files with 14 additions and 0 deletions

View File

@ -58,6 +58,7 @@ const STAGE = 'Stage',
[POINTERMOVE, '_pointermove'],
[POINTERUP, '_pointerup'],
[POINTERCANCEL, '_pointercancel'],
[POINTERLEAVE, '_pointerleave'],
[LOSTPOINTERCAPTURE, '_lostpointercapture'],
];

View File

@ -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();