Drag Events in Modal View


#1

I have a fullscreen (width: 100%, height: 100%) modal panel where I want some DOM elements to be sortable / draggable.

The problem is that no drag events gets triggered and no html drag animation.

I have set the draggable attribute on the elements to true, and drag + events are working when opening the same view in a pane instead.

Can be tested by putting the following in a pane view vs a modal panel view, with some elements to move:

initialize: ->
  @on 'dragstart', @onDragStart

onDragStart: (event) ->
  event.originalEvent.dataTransfer.setData 'atom-event', 'true'
  console.log event

Could this be caused by some css property set on modals in Atom?


Drag & Drop
#2

I solved this myself by setting css properties -webkit-user-drag: element; on the container and -webkit-user-drag: initial; and the dragable part.