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

Adjusting the StackGrid component's width breaks the display #67

Open
loganmay opened this issue Aug 20, 2019 · 1 comment
Open

Adjusting the StackGrid component's width breaks the display #67

loganmay opened this issue Aug 20, 2019 · 1 comment

Comments

@loganmay
Copy link

First off, I'd like to say that this Component is awesome and I've really enjoyed using it in my project! Thanks so much for the fantastic work!

I did run into an issue, however. I have the stack grid set up as follows:
<StackGrid {...this.getStackGridProps()} style={{width: this.props.width}}> {this.renderGridItems()} </StackGrid>

Some logic outside of the component toggles that width style prop between 50% and 100%. When going from 100% to 50%, the grid always arranges in interlocking perfection. However, when going from 50% to 100%, there are uneven spaces between the grid items. Here's a picture with some scribbled arrows pointing to the spaces that shouldn't be there.

I've experimented with calling updateLayout() on a ref attached to the StackGrid component, as well as using different values for the width (e.g. vw instead of %), but that hasn't seemed to make a difference.

If you have any thoughts or can look more into this, please let me know!

I also had another error where certain rerenders caused the items to scramble around on the screen with similar uneven gaps to the ones pictured. I can follow up with another issue there if the maintainers so desire. Thanks!

@Bulala-liu
Copy link

I also have the problem. I just set like this : <StackGrid columnWidth={'50%'} gutterWidth={25}>

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