Skip to content

Draggable Doesn't Recover Animation - H5 #1966

@edancanning

Description

@edancanning

Subject of the issue

After dragging an element on the grid, it no longer animates when moved by another draggable.

ezgif-1-1f9d660334

Your environment

Gridstack: 5.0.0 w/ H5 DnD

Steps to reproduce

You can reproduce in Gridstack demo: https://gridstackjs.com/demo/two.html

  1. Drag an element around (notice other elements animate correctly)
  2. Drag a different element
  3. Move the first element using the second
  4. Notice first element does not animate

Expected behavior

I expect any element to recover its animation after dragging

Actual behavior

Elements stop animating after being dragged

Potential Reason

In dd-draggable -> _removeHelperStyle()

Looks like timeout is being executed after helper is removed. So I'm assuming this is why it doesn't recover the animation

   setTimeout(() => {
                if (this.helper) { <-- false
                    this.helper.style.transition = this.dragElementOriginStyle['transition']; // recover animation
                }
            }, 0);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions