Skip to content

Commit

Permalink
fixes 2
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt committed Feb 21, 2025
1 parent c425fcd commit 45451ad
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
3 changes: 1 addition & 2 deletions packages/playwright-core/src/server/frames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 0 additions & 2 deletions tests/assets/drag-n-drop-manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,13 @@
sourceElement.style.border = 'dashed'
});

// Mouse move handler - move the element
document.addEventListener('mousemove', function(e) {
if (!isDragging) return;

sourceElement.style.left = (e.clientX - offsetX) + 'px';
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;

Expand Down
4 changes: 2 additions & 2 deletions tests/page/page-drag.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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 },
]);
Expand Down
2 changes: 1 addition & 1 deletion tests/playwright-test/playwright-test-fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export type RunResult = {
interrupted: number,
didNotRun: number,
report: JSONReport,
results: JSONReportTestResult[],
results: any,
};

type TSCResult = {
Expand Down

0 comments on commit 45451ad

Please sign in to comment.