hootsuite / grid

Drag and drop library for two-dimensional, resizable and responsive lists
http://hootsuite.github.io/grid/
Apache License 2.0
3.57k stars 279 forks source link

Unable to move cells to certain positions #21

Closed Deco closed 8 years ago

Deco commented 10 years ago

In Chrome 33.0.1750.152, cell dragging does not work as expected in certain situations. In the following situation, attempting to drag a cell (e.g: 1) to be between one of the following pairs does not work: 3-2, 2-7, 7-6, 6-9, 9-4, 3-5 and 5-10.

screen shot 2014-04-01 at 8 45 07 am

ovidiuch commented 10 years ago

Hi @Deco,

The problem was there were some items with height bigger than the current number of rows (item "3" has height 3 and your grid has 2 rows.) We haven't figured out how to handle this so far, but it wasn't a big problem either, since we can control the number of rows and not allow a smaller number than the tallest widget.

A more peculiar item time we use is one with height=0, which means it will stretch 100%. I updated the demo with items that only have 1x or 100% height until in the meantime.

Can you please give it another go and let me know if you feel anything weird anymore?

Deco commented 10 years ago

Yep, that fixed it.

Here's some ideas:

Nice work on this library, btw! Very handy.

ovidiuch commented 10 years ago

Very good insights. I'm thinking a combination between 1. or 3., since 2. means managing the content of a item and maybe breaching the scope of an agnostic lib.

Regardless, the lib should have some sanity checks and besides some weird overflowing the rest of the items should be positioned correctly. Leaving this open until I or someone else finds the time to right a quick regression test and make sure it doesn't break when you add an item larger than the grid configuration.

Thanks!

solerman commented 8 years ago

I think this one is fixed already