metal / metal-plugins

A collection of utilities that are often used in Metal.js projects, such as Ajax, Promise, URI, etc
Other
5 stars 11 forks source link

[metal-drag-drop] Draggable elements are not clickable #111

Closed p2kmgcl closed 5 years ago

p2kmgcl commented 5 years ago

Once you set a draggable element with metal-drag-drop, there is no way to make it clickable without using a handler.

diegonvs commented 5 years ago

Could you give me more details @p2kmgcl? Are you needing a new emmiter like Drag.Events.INTERACT, that will be emitted when have any interactions in sources elements before a START for example?

p2kmgcl commented 5 years ago

When an item is added as metal-drag-drop source, metal captures mousedown event, and for that reason links and buttons stop working.

In this case:

screenshot_2019-01-15_16-29-27

We needed to add a drag handler, because otherwise the item is not clickable anymore.

diegonvs commented 5 years ago

This behaviour occurs when useShim option isn't not setted to false. When you don’t pass false for this option, a DragShim is enabled for your Drag instance. basically this shim is used to attach events of Drag move and end like mousemove and mouseup to a shim element that can be placed above the document do hear these events. This functionality is important for dragging nodes over iframes. If false, these events of Drag move and end will be attached in the document :slightly_smiling_face: