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

How to use max-height instead of height for FixedSizeList #214

Closed
ajayns opened this issue Apr 17, 2019 · 3 comments
Closed

How to use max-height instead of height for FixedSizeList #214

ajayns opened this issue Apr 17, 2019 · 3 comments

Comments

@ajayns
Copy link

ajayns commented Apr 17, 2019

In the case that the list has the possibility of being of very few items that it doesn't even fill the specified fixed height, it keeps rest of the space empty. I'd prefer if it automatically wrap itself as per the height of the content, much like how max-height would work.

Any suggestions on how to implement this? For the library maybe it'd be great if it took care of this internally.

@nihgwu
Copy link
Contributor

nihgwu commented Apr 17, 2019

that should not be builtin, you could implement it by <List height={Math.min(containerHeight, itemHeight * itemCount) />

@bvaughn
Copy link
Owner

bvaughn commented Apr 17, 2019

The approach @nihgwu shows above is correct.

@bvaughn bvaughn closed this as completed Apr 17, 2019
@ajayns
Copy link
Author

ajayns commented Apr 22, 2019

Thank you!

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

3 participants