chris-l / bin-packing-grid

Web component that fit elements into a grid using bin-packing, in a masonry-like way. Similar to what pinterest and other sites have
http://chris-l.github.io/bin-packing-grid/
122 stars 9 forks source link

Issue with using bin-packing-grid in polymer templates #7

Open yorrd opened 8 years ago

yorrd commented 8 years ago

Hi, thanks for your awesome work.

I'm writing a meteor application with polymer templates (using synthesis).

When using your element in the main.html (directly in the body tag), it works like a charm. However, when I use it in a nested dom-module and include that dom-module in my main.html, it does not. I have already made sure that the bin-packing-grid item has the correct size (not 0x0).

Any input on this? Let me know if I can provide you with further data. I don't have a public meteor host, otherwise I would share a sample. If you can't reproduce it, I'll zip you something.

yorrd commented 8 years ago

Followup: this seams to fail, width and height are never set:

  element.style.width = (element.columns * (element.cellSize + element.gutterSize) - element.gutterSize) + 'px';

also

  width = element.clientWidth;

returns 0