jbaysolutions / vue-grid-layout

A draggable and resizable grid layout, for Vue.js.
https://jbaysolutions.github.io/vue-grid-layout/
MIT License
7.1k stars 1.5k forks source link

Drag from outside element render lagging #544

Open comdet opened 3 years ago

comdet commented 3 years ago

Hi, I use Vue-Grid-Layout in my project and found the drag from outsize element shadow box display lagging, and this behavior even worse in slow browser or slow PC. The won't happen when dragging element inside grid layout, only for outsize element.

I use this example : https://jbaysolutions.github.io/vue-grid-layout/guide/10-drag-from-outside.html

oddjobz commented 3 years ago

I've had this too .. problem seems to be this, if you're working from the example;

document.addEventListener("dragover", function (e) {
            mouseXY.x = e.clientX;
            mouseXY.y = e.clientY;
        }, false);

Not sure specifically why, but if I replace this with;

document.onmousemove = function (event) {
    this.onDragOver(event)
}.bind(this);

.. obviously I need to adapt things a little, but this provides a better solution .. replacing Vue's built-in drag handler with "vue-smooth-dnd" now yields a very smooth / performant solution.

miguelsalameh commented 3 years ago

Any updates on this one ? we're having the same problem and its freezing the browser after multiple drops