This commit is contained in:
Max Schmitt 2025-02-21 14:35:42 +01:00
parent c425fcd474
commit 1e6410ba67
3 changed files with 3 additions and 6 deletions

View file

@ -1211,8 +1211,7 @@ export class Frame extends SdkObject {
dom.assertDone(await this._retryWithProgressIfNotConnected(progress, target, options.strict, false /* performActionPreChecks */, async handle => {
return handle._retryPointerAction(progress, 'move and up', false, async point => {
// NOTE: Normal browsers emit usually a lot of dragover/mousemove events during drag'n
// drop operations. We want to emit minimal to make the ecosystem work. When using
// Native drag'n drop the browser does emit dropover events instead.
// drop operations. We want to emit minimal (2) to make Angular CDK work.
await this._page.mouse.move(point.x, point.y);
await this._page.mouse.move(point.x, point.y);
await this._page.mouse.up();

View file

@ -62,7 +62,6 @@ div:not(.mouse-helper) {
sourceElement.style.border = 'dashed'
});
// Mouse move handler - move the element
document.addEventListener('mousemove', function(e) {
if (!isDragging) return;
@ -70,7 +69,6 @@ div:not(.mouse-helper) {
sourceElement.style.top = (e.clientY - offsetY) + 'px';
});
// Mouse up handler - stop dragging and check if dropped on target
document.addEventListener('mouseup', function(e) {
if (!isDragging) return;

View file

@ -64,7 +64,7 @@ it.describe('Drag and drop', () => {
browserName === 'firefox' ? 'mousemove at 240;350' : 'dragstart at 120;86',
'dragenter at 240;350',
// NOTE: Normal browsers emit usually a lot of dragover events during drag'n
// drop operations. We want to emit minimal (2) to make the ecosystem work.
// drop operations. We want to emit minimal (2) to make Angular CDK work.
'dragover at 240;350',
'dragover at 240;350',
'drop at 240;350',
@ -334,7 +334,7 @@ it.describe('Drag and drop', () => {
expect(await events.jsonValue()).toEqual([
{ type: 'mousemove', x: 120, y: 86 },
// NOTE: Normal browsers emit usually a lot of mousemove events during drag'n
// drop operations. We want to emit minimal(2) to make the ecosystem work.
// drop operations. We want to emit minimal (2) to make Angular CDK work.
{ type: 'mousemove', x: 240, y: 350 },
{ type: 'mousemove', x: 240, y: 350 },
]);