bmcmahen / react-grid-dnd

drag and drop, grid edition. built with react
https://codesandbox.io/embed/gracious-wozniak-kj9w8
219 stars 49 forks source link

RowHeight and Container Height "auto" or "%" #52

Open ronaldux opened 3 years ago

ronaldux commented 3 years ago

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.

gabrielew commented 1 year ago

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
sarnason commented 1 year ago

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

igagandeep commented 1 year ago

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