Skip to content

Commit

Permalink
fix(click): revert layout shift logic
Browse files Browse the repository at this point in the history
  • Loading branch information
dgozman committed Dec 1, 2021
1 parent 5c93066 commit f096b39
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/playwright-core/src/server/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ export class ElementHandle<T extends Node = Node> extends js.JSHandle<T> {
const point = roundPoint(maybePoint);
progress.metadata.point = point;

if (process.env.PLAYWRIGHT_NO_LAYOUT_SHIFT_CHECK)
if (!process.env.PLAYWRIGHT_LAYOUT_SHIFT_CHECK)
return this._finishPointerAction(progress, actionName, point, options, action);
else
return this._finishPointerActionDetectLayoutShift(progress, actionName, point, options, action);
Expand Down
4 changes: 4 additions & 0 deletions tests/hit-target.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ it('should block all events when hit target is wrong', async ({ page, server })
});

it('should block click when mousedown succeeds but mouseup fails', async ({ page, server }) => {
it.fixme();

await page.goto(server.PREFIX + '/input/button.html');
await page.$eval('button', button => {
button.addEventListener('mousedown', () => {
Expand Down Expand Up @@ -82,6 +84,8 @@ it('should click when element detaches in mousedown', async ({ page, server }) =
});

it('should not block programmatic events', async ({ page, server }) => {
it.fixme();

await page.goto(server.PREFIX + '/input/button.html');
await page.$eval('button', button => {
button.addEventListener('mousedown', () => {
Expand Down

0 comments on commit f096b39

Please sign in to comment.