gridster.js icon indicating copy to clipboard operation
gridster.js copied to clipboard

Reordering stucks in some situations

Open KristofMorva opened this issue 8 years ago • 4 comments

I don't know if these problems have any connection, so I only open one ticket. The problem is, in some situations we can't drag&drop like we could have some versions before. For example this item just cannot be moved one column to the left: Example Sometimes bigger items are not moving smaller items away while dragging, making it impossible to drop, and in rare situations you can place items above each other. Lastly, if you drag one item, you can keep pushing another item out in nowhere without limits. All of these can be reproduced easily on the main page of the official GitHub website (http://dsmorse.github.io/gridster.js/)

KristofMorva avatar Feb 29 '16 12:02 KristofMorva

Same here! I can't upgrade to the latest version because it completely breaks the drag/collision handling on my dashboards.

heartdisease avatar Mar 07 '16 10:03 heartdisease

Seems like I've found the piece of code that causes this issue. The bug got introduced with bug fix #43 from @mmontero that got merged a few days ago.

There must be something wrong with the calculation of the y-units (cellsToMove) in method on_stop_drag:

// get number of cells to move var destinyRow = this.placeholder_grid_data.row + this.placeholder_grid_data.size_y; var currentOverlappedRow = parseInt(this.gridmap[tcol][trow][0].getAttribute('data-row')); var cellsToMove = destinyRow - currentOverlappedRow; this.move_widget_down(this.is_widget(tcol, trow), cellsToMove);

If I replace cellsToMove with this.placeholder_grid_data.size_y everything works again as it did before the change. Unfortunately I don't really understand what is being done here so it'd be great if the user who made the original pull request could fix this.

heartdisease avatar Mar 09 '16 16:03 heartdisease

I'm also experiencing this issue. Drag is completely unusable in my app after switching to this dsmorse fork for responsiveness. I applied the fix above, but dragging is still slow, buggy, and unusable.

parliament718 avatar Mar 10 '16 23:03 parliament718

Same here! In the version 0.6.9 it works properly.

marctc avatar Nov 22 '16 15:11 marctc