bmcmahen / react-grid-dnd

drag and drop, grid edition. built with react

Home Page:https://codesandbox.io/embed/gracious-wozniak-kj9w8

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RowHeight and Container Height "auto" or "%"

ronaldux opened this issue · comments

We need to make it responsive and now these properties are just in number, I need to set it to auto to calculate rowHeight and container height.

I had to do some calc to present the right amount of items per row;

const MAX_ITEM_WIDTH = 350 // your div
const ITEMS_PER_ROW = Math.ceil(window.innerWidth / MAX_ITEM_WIDTH) // boxesPerRow

Fantastic. Works great. Just need to subscribe to the window resize event as well.
Would be great if the component had this automatically.

Hi, @ronaldux, did you find any solution that how to make the rowHeight to auto?