-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Hammer.js overrides native drag&drop #1457
Comments
This is because the MdGestureConfig is registering the drag event in Angular's event manager. It would be probably better to just have the |
@devversion I think the drag event should be sufficient for gestures, if needed. dragstart and dragend* are required for HTML5 drag and drop and should not be overridden. |
I agree that we shouldn't be clobbering the native drag events. |
In the mean time, I found, you can add the following to app.module to revert to native drag events.
|
#1025 is the same issue |
@jimitndiaye I did not mean to remove the Anyways it seems that
|
Closed via #1458 |
When this correction will be available ? Sincerly |
@mwamufiya, I follow the advice from @gatimus. But it is just a temporary fix. It is just for having a date of release. Thank for your quick reply =) |
Is this released ? Can we drag and drop rows in cdktables ? |
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. |
Bug, feature request, or proposal:
Probably a bug. Might be a proposal. Not entirely sure.
What is the expected behavior?
You should be able to use native HTML5 drag&drop, at least on non-Material elements.
What is the current behavior?
The dragstart event gets overriden by Hammer.js, so you can't access required event properties like dataTransfer.
What are the steps to reproduce?
With Hammer.js installed, bind the dragstart event to a function and try to access dataTransfer. It will be undefined.
Alternatively uninstall Hammer.js and do the dame steps. You will get the error message: "Hammer.js is not loaded, can not bind dragstart event".
For the first case I set up a plunker right here: http://plnkr.co/edit/CMzTNi0HKVxI9xI3ztsc?p=preview Make sure to check console output once you start dragging the first div.
What is the use-case or motivation for changing an existing behavior?
Angular Material 2 should not prevent you from using native APIs on other tags.
Which versions of Angular, Material, OS, browsers are affected?
Tested with Angular 2.0.1, Material 2.0.0-alpha.9-3 and Hammerjs 2.0.8
All browsers should be affected. Tested with Firefox 49.0.1 and Chrome 53.0.2785.143
Is there anything else we should know?
Overriding dragstart should not be necessary during Hammerjs initilisation. The drag event contains all necessary information.
You can read the discussion on Reddit for additional information: https://www.reddit.com/r/Angular2/comments/56kh4g/html5_drag_drop/
The text was updated successfully, but these errors were encountered: