-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(drag-n-drop): send two mousemove events to target to make Angular CDK work #34882
base: main
Are you sure you want to change the base?
Conversation
38e4fb8
to
b930eba
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the change itself looks good, but it looks like the test doesn't pass on CI
This comment has been minimized.
This comment has been minimized.
8e183b6
to
45451ad
Compare
This comment has been minimized.
This comment has been minimized.
45451ad
to
1e6410b
Compare
Test results for "tests others"1 failed 21704 passed, 504 skipped Merge workflow run. |
Test results for "tests 1"6 flaky38684 passed, 794 skipped Merge workflow run. |
Test results for "tests 2"1 fatal errors, not part of any test 130 flaky263254 passed, 10048 skipped Merge workflow run. |
@@ -1210,6 +1210,9 @@ export class Frame extends SdkObject { | |||
// Note: do not perform locator handlers checkpoint to avoid moving the mouse in the middle of a drag operation. | |||
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 (2) to make Angular CDK work. | |||
await this._page.mouse.move(point.x, point.y); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fishy. Feels like we are working around Angular implementation problem. We could extend the API to allow passing steps
, similar to
mouse.move({steps}) and leave the users in control of whether they want intermediate move events, WDYT?
Background:
There are two types of Drag & Drop in the web:
Native HTML5 Drag and Drop (drag-n-drop.html)
draggable="true"
attributedragstart
,dragover
,drop
)mousemove
to drag events during operationdrag-n-drop.html
Uses raw mouse events (mousedown, mousemove, mouseup)
mousemove
events throughout the operationIn this PR I had to add the latter with an expectation that there should be two
mousemove
events emitted.Fixes #34688