Skip to content

Elements vanish when dragging/dropping fast #1578

Closed

Description

@yassine-ah

Subject of the issue

Elements vanish when dragging/dropping fast.

Your environment

gridstack.js H-5 v3.1.4
Mozilla Firefox 84.0.2 and Microsoft Edge 87.0.664.75

Steps to reproduce

Just drag/move/drop fast, you can use the official demo: https://gridstackjs.com/demo/two.html
Here a video: https://www.loom.com/share/008049b00f344f55ba8e3df90e17a50a

Expected behavior

The element will appear in the other grid

Actual behavior

The element vanish from the two grids

Activity

  1. jezaman commented on Feb 1, 2021

    @jezaman

    Any idea on what is causing this? any known workarounds?

  2. adumesny commented on Feb 1, 2021

    @adumesny
    Member

    yeah there is a 2sec delay to remove (removeTimeout:2000 grid options default). Try setting this to 0. not sure why there is a delay at all...I suspect that is causing issues and not sure why it's there.

  3. jezaman commented on Feb 1, 2021

    @jezaman

    Thanks for your reply, but removeTimeout: 0 does not fix this.

    removeTimeout also seems to be about something else, aka how long to leave an element outside the grid for it to be removed.
    This issue is about quickly dragging elements between grids, the drag time is way less than 2000ms anyway.
    Items seems to disappear when in drag-mode limbo. when you drag an item, but the drop location hasn't appeared yet. Rather than snapping back to its origin in the first grid, the element just disappears.

    To whom it may concern / help locate the issue: the disappearing elements do not trigger any change / added / remove event in any of the grids. Inspecting the grid does show the item to be gone, not just hidden or anything. the actual HTML node is gone.

  4. adumesny commented on Feb 3, 2021

    @adumesny
    Member

    | Items seems to disappear when in drag-mode limbo. when you drag an item, but the drop location hasn't appeared yet

    that could be the key. thanks will take a look. happens in h5 and jq version

    Update: found that onDrag() event doesn't happen after 'dropover' happens when going very fast so item is never added to the other grid (no placeholder is the key) but marked for removal from first grid so will be gone. Unfortunately it's more complicated and after spending 2h it looks like I may need to revisit how drag between grids works as I can get it where it still in the old one but hidden... Yike. Staging work for now in sandbox

  5. adumesny commented on Mar 8, 2021

    @adumesny
    Member

    took a long time to figure out timing issue. added console.log() (commented out) next time I need to track event orders... fix in v4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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