Sortable: Firefox 49.0.2 drag and drop will open a new TAB

Created on 25 Oct 2016  Â·  17Comments  Â·  Source: SortableJS/Sortable

http://rubaxa.github.io/Sortable/

Firefox 49.0.2 The default opens the drag and drop gesture,drag and drop will open a new TAB;

help-wanted

Most helpful comment

I find a solution, it works:

document.body.ondrop = function (event) {
    event.preventDefault();
    event.stopPropagation();
}

All 17 comments

I had some other issues with Sortable.js and Firefox 49. Text Input Fields inside a sortable element were not selectable anymore.

In my case, I could fix it by removing / commenting out the following line:
dragEl.style['will-change'] = 'transform';

Maybe it's the same issue and this workaround works for you as well?

Sortable working fine on jquery-sortable but No jQuery Firefox open a new tab, No jQuery there is no quick solution?

i also met。firefox49.0.2 。I removed dragEl.style['will-change'] = 'transform'; but it is not ok。

same Q.

also

I have the same Q too.It's a firefox drag feature, not a bug. You can disable it by settings.
looked at about:addons

I find a solution, it works:

document.body.ondrop = function (event) {
    event.preventDefault();
    event.stopPropagation();
}

I have the same Q too.Thanks to RoamIn ! I have fixed it with the solution of RoamIn.

Thanks RoamIn. It really works!

Thanks @RoamIn

Thanks

@RoamIn your solution works, but all the dom on the page can not receive any drag event!

@RoamIn your solution works, but all the dom on the page can not receive any drag event!

Pity...

Solution follows. I changed
var internalDNDType = 'text';
to


22 var internalDNDType = 'whatever';
23 function dragStartHandler(event) {
25 if (event.target instanceof HTMLLIElement) {
27 event.dataTransfer.setData(internalDNDType, event.target.dataset.value);
28 event.dataTransfer.effectAllowed = 'move'; // only allow moves
29 } else {
30 event.preventDefault(); // don’t allow selection to be dragged
31 }
32 }

and the trouble is over.

This is due to your browser extension. You can get around this yourself if you use setData:

new Sortable(myList, {
    setData(dataTransfer) {
        // use dataTransfer.setData to set data
    }
});

This is due to your browser extension. You can get around this yourself if you use setData:

new Sortable(myList, {
    setData(dataTransfer) {
        // use dataTransfer.setData to set data
    }
});

Nice work. it is better than setting 'ondrop ' on body!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dwburdick picture dwburdick  Â·  3Comments

Webifi picture Webifi  Â·  3Comments

artaommahe picture artaommahe  Â·  4Comments

irfanlone picture irfanlone  Â·  3Comments

rakeshrockb picture rakeshrockb  Â·  3Comments