Commit Graph

4 Commits

Author SHA1 Message Date
Dmitry Gozman
045cf1a56e
test: add a test for clicking on material ui select (#10652) 2021-12-01 15:14:28 -08:00
Dmitry Gozman
6e00af3b2e
fix(click): revert layout shift logic (#10653) 2021-12-01 12:54:20 -08:00
Dmitry Gozman
9ec3e7cd52
fix(click): account for detached elements and iframe overlays (#10206) 2021-11-10 12:14:06 -08:00
Dmitry Gozman
61ff52704c
feat(input): perform hit target check during input (#9546)
This replaces previous `checkHitTarget` heuristic that took place before the action
with a new `setupHitTargetInterceptor` that works during the action:
- Before the action we set up capturing listeners on the window.
- During the action we ensure that event target is the element we expect to interact with.
- After the action we clear the listeners.

This should catch the "layout shift" issues where things move
between action point calculation and the actual action.

Possible issues:
- **Risk:** `{ trial: true }` might dispatch move events like `mousemove` or `pointerout`,
because we do actually move the mouse but prevent all other events.
- **Timing**: The timing of "hit target check" has moved, so this may affect different web pages
in different ways, for example expose more races. In this case, we should retry the click as before.
- **No risk**: There is still a possibility of mis-targeting with iframes shifting around,
because we only intercept in the target frame. This behavior does not change.

There is an opt-out environment variable PLAYWRIGHT_NO_LAYOUT_SHIFT_CHECK that reverts to previous behavior.
2021-11-05 17:31:28 -07:00