Not able to get dragstart event in panel


I’m trying to create a package that provides draggable element in a panel (specifically re-ordering headings in I am using the file tree-view package as a base (though I’m using es6 instead of coffeescript). But I just cannot get ‘dragstart’ events to trigger. Based on HTML docs and on tree-view, all I should need is to set the draggable=true and add an event handler, but I just got no dragstart events and no dragging behaviour :confused:

I tried stripping out all of my code and built a mock panel with drag behaviour based on - no dependencies just vanilla js/dom - and I still get no dragging behaviour and no drag events logged. But I can see in the debug inspector under ‘event listeners’ that my callbacks are registered, but something is apparently blocking the drag behaviour. Anyone got any ideas what i’m missing?

'use babel';

function onDragStart(event) {
  event.dataTransfer.setData('text/html', null); // cannot be empty string

function onDragOver(event) {
  var counter = document.getElementById('counter');
  counter.innerText = parseInt(counter.innerText, 10) + 1;

export default class DocumentOutlineView {

  constructor(editor, docModel) {
    this.editor = editor;
    // Create root element
    this.element = document.createElement('div');
    this.panel = atom.workspace.addRightPanel({item: this.element});

    let dragel = document.createElement('div'); = 'draggable';
    dragel.setAttribute('draggable', true);

    let dropel = document.createElement('div'); = 'dropzone';
    dropel.setAttribute('dropzone', true);

    dragel.addEventListener('dragstart', onDragStart, false);
    dropel.addEventListener('dragover', onDragOver, false);

  // Tear down any state and detach
  destroy() {

  getElement() {
    return this.element;

  hide() {

  show() {;

  toggle() {
    if (this.panel.isVisible()) {
    } else {;


I have same issue…
there are ‘onDragStart’ and ‘onDragOver’ not fired… (in my custom package - panel…)
Anyone know how to fix it?