Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rowHeight issue with margin #2050

Open
rumeshudash opened this issue Jun 26, 2024 · 1 comment
Open

rowHeight issue with margin #2050

rumeshudash opened this issue Jun 26, 2024 · 1 comment

Comments

@rumeshudash
Copy link

rumeshudash commented Jun 26, 2024

Describe the bug

Having issue with height of grid when setting custom rowHeight & margin. Row height is also adding margin into its height calculation.
For example: rowHeight = 20 & margin = [12,12], then final rowHeight of grid will be 1 * 20(rowHeight) 12(margin[0]).

Your Example Website or App

https://codesandbox.io/p/sandbox/infallible-bessie-rlpvdz?file=/src/App.tsx:17,38

Steps to Reproduce the Bug or Issue

  1. Navigate to the codesandbox and start the environment
  2. Inspect the hight of all 3 card. you can see the differences.

Expected behavior

Card 1 is taking 20 px height as expected.
But card 2 & 3 height should be 2 * 20px = 40px & 3 * 20px = 60px respectively

react-grid-layout library version

1.4.4

Operating System Version

macOS

Browser

Chrome

Additional context

No response

Screenshots or Videos

image
image

@optimistic-updt
Copy link

hey mate, I think that's an expected behaviour as written in the docs
https://github.com/react-grid-layout/react-grid-layout?tab=readme-ov-file#grid-item-heights-and-widths

;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants