vue-grid-layout icon indicating copy to clipboard operation
vue-grid-layout copied to clipboard

GridItem element's height value seems not equal to (rowHeight * GridItem.h)

Open minikinl opened this issue 7 years ago • 5 comments

In my case, rowHeight is 15 and GridItem props h is 15, but the rendered element's height is 365px ? Normally it should be 15 * 15 = 225px, right ?

minikinl avatar Mar 14 '18 02:03 minikinl

From issue #73, I find an example.

I found a formula

newH = Math.ceil((clientHeight + marginY) / (rowHeight + marginY))

OK, this formula can answer why the rendered element's height is 365px ...

But why should marginY be calculated together?

thanks 0.0

minikinl avatar Mar 14 '18 06:03 minikinl

Same problem. I found it weird.

ozgurrgul avatar Mar 22 '18 10:03 ozgurrgul

同样的问题。我发现它很奇怪。其实真实高度是(row-height)*item.y +marginY * (item.y-1)

Neolnevergiveup avatar Mar 27 '18 09:03 Neolnevergiveup

HI, Has it been resolved?

oo10 avatar Mar 21 '24 13:03 oo10

HI, Has it been resolved?

One solution is to set the margin to [x, 0], so there will be no deviation in clientHeight. You can simulate the margin within the griditem.

oo10 avatar Mar 21 '24 13:03 oo10