flekschas/piling.js

Toggling cellAspect ratio destroys items and layout?

Closed this issue ยท 6 comments

Commit or branch: master

Observed behavior:

  • Upon disabling cellAspect all items disappear ๐Ÿ˜ฑ
  • When activating cellAspect: 1 again they reappear but are all positioned on top of each other ๐Ÿค”
  • Upon toggling of cellAspect all items disappear for good and never re-appear again ๐Ÿ˜ž

Feb-19-2020 17-02-59

Expected behavior:

  • The items should not disappear and they should also not be positioned on top of each other

I think the problem is solved now.

Feb-20-2020 17-44-30

But if we disable both itemSize and columns then all things will disappear. I don't know whether we should fix this or not, since we said that one must provide itemSize or columns.

Looks good. I think it is fine if everything disappears when itemSize and columns are null as this is an incorrect setting. We could, of course, disallow both from being null but that's not urgent. We should just need to make sure that when itemSize or columns is set again that the piles reappear :)

By the way, what was the issue that caused the piles to disappear permanently with the aspect ratio?

Oh, it's because I didn't take care of the situation when rowHeight and cellAspectRatio are both null. Currently, if the grid system is incomplete, the piles would disappear for good ๐Ÿ˜‚I'll try to fix this issue.

I set the column number to 10 by default if both itemSize and columns are null, now the piles won't disappear.

Feb-21-2020 13-04-49

Does it make sense?

Yes, that sounds good :) Please either merge the fix right away or setup a PR

I pushed to master already.