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

Unable to get the responsive design without specifying the height(itemHeight) in Grid and child component #24

Closed
ALBERT-JEGAN opened this issue Feb 16, 2017 · 2 comments

Comments

@ALBERT-JEGAN
Copy link

ALBERT-JEGAN commented Feb 16, 2017

Hi,
we are not able to get the responsive design while adding the data dynamically in to the box of GRID. we are not knowing the height of the box and dynamically it will change. so Can you please help me solve the issue?

const Grid = measureItems(SpringGrid);
<Grid component="div" columnWidth={257} gutterWidth={5} columns={3} gutterHeight={5} layout={layout.pinterest} duration={800} easing="ease-out" measured={true}>
					{	
						this.state.selectedFilter.map(function(compObj, idx){
							return(
								<div className="grid-item"  key={compObj.compName} style={{width: 257,height:'auto'}}>
									<FilterInfoBox filterObj={compObj} filterRemoveFn={_this.toggleFilter}/>
								</div>)
						})
					}
</Grid>
@ALBERT-JEGAN
Copy link
Author

I am facing the same issue as https://github.com/dantrain/react-stonecutter/issues/2. But here i m adding the content dynamically inside a FilterInfoBox component. So Can you please help me to calculate box height dynamically

@dantrain
Copy link
Owner

Hi,

The way measureItems works is by measuring the heights and caching these values in an object for performance. It's not meant to support items that constantly change their heights. If you want this feature I suggest you write your own version of the measureItems higher-order component and use that with the SpringGrid.

https://github.com/dantrain/react-stonecutter/blob/master/src/higher-order-components/measureItems.jsx

I've made another example of measuring content of unknown height, please check it out:
https://github.com/dantrain/stonecutter-images-example

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