-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Dispatching MouseEvents is broken after upgrade from version 13.1.2 to 13.1.3 #24577
Comments
There haven't been any fundamental changes in |
@crisbeto I don't think so. I could really pinpoint the problem to this specific version update. |
@crisbeto the problem is probably not in drag drop, but in handling mouseevents. I saw some changes related to that, but don't know if they are causing the issue. |
Handling of mouse events by which module? |
I don't know the codebase and I might be completely wrong, but I was referring to #23493 |
If #23493 broke anything, it would've only prevented focus indication from showing up on some components. It wouldn't affect any other event listeners. |
Then it has to be something else, bumping the installed version from 13.1.2 to 13.1.3 (@angular/cdk & @angular/material) breaks our drag/drop tests. It looks like mouseevents are ingored, nothing moves anymore after the update. |
Is it possible that Cypress changed how they're dispatching events? |
No, I narrowed it down to only this version update. If I install 13.1.2 it works, if I install 13.1.3 it doesn't. |
I'm looking through the changelog between 13.1.2 and 13.1.3, and I really don't see anything that could break event handling. |
@crisbeto thank you for looking into this. I double checked it again, but it is really this version. I could narrow it even further to only @angular/cdk package. Here is a screenshot of my changes: only updating this single version breaks drag an drop testing. |
@crisbeto I think the issue is related to #23493. If I add buttons: 1 to my mouse events it works.
original doesn't work:
|
Interesting, I wonder if your test depends upon the extra change detection that is triggered by focus monitor. If that's the case, you may end up broken again by #15077 which is close to being merged. |
I can confirm that it also broke our Cypress tests related to drag-n-drop after upgrading from 13.1.2 to 13.1.3 without any other changes. |
This upgrade broke our drag & drop tests too. Was wondering why these tests are not failing. |
I've just discovered, that from version @angular/[email protected] you need to set both of those properties ( new MouseEvent(eventName, {
bubbles: true,
buttons: 1, // Primary button (https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons#value)
cancelable: true,
clientX: coords.x,
clientY: coords.y,
detail: 1, // This needs to be added since @angular/[email protected]
}); Caused by this change #28029 |
Closing since there appears to be workaround. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Is this a regression?
The previous version in which this bug was not present was
13.1.2
Description
After upgrading from 13.1.2 to 13.1.3 our drag and drop tests are failing. It looks like nothing is happening and the events are ignored.
We are using Cypress in similar approach to here: https://stackoverflow.com/questions/55361499/how-to-implement-drag-and-drop-in-cypress-test/55436989#55436989
Reproduction
Steps to reproduce:
Upgrade from 13.1.2 to 13.1.3
Expected Behavior
Able to test drag drop behavior by disptaching mouseevents
Actual Behavior
Mouse events are ignored
Environment
The text was updated successfully, but these errors were encountered: