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

[Bug] List with CellMeasurer does not render correctly #866

Closed
steinso opened this issue Nov 3, 2017 · 13 comments · Fixed by #959
Closed

[Bug] List with CellMeasurer does not render correctly #866

steinso opened this issue Nov 3, 2017 · 13 comments · Fixed by #959
Labels

Comments

@steinso
Copy link

steinso commented Nov 3, 2017

Reproducible case: https://plnkr.co/edit/5I4FzHs8juZ4L6m5NKwV?p=preview

When rendering a List with a CellMeasurer (and deferredMeasurementCache) all rows are rendered on top of each other, only when you start to scroll the items are rendered. Also notice how it does not invalidate the dimensions of the initially rendered rows, and they all get the default height. Any rows not initially rendered are measured and rendered correctly.

My initial findings are that the Grid on List is not initialized at the point where cells are measured, therefore the invalidateCellSizeAfterRender is not called.

This was working prior to version 9.10.0.

@krsnaa
Copy link

krsnaa commented Nov 4, 2017

+1. an easy workaround for the cell sizing appears to be to pass in the function form ({ measure }) => ) instead of the actual element to the CellMeasurer and call measure from inside.

@bvaughn bvaughn added the bug label Nov 9, 2017
@reganperkins
Copy link

+1

1 similar comment
@smerat
Copy link

smerat commented Nov 9, 2017

+1

@Cordazar
Copy link

Cordazar commented Nov 17, 2017

@krsnaa Your idea doesn't work either in my project or in the plunkr that steinso posted.

+1 for fixing this bug.

@bvaughn
Copy link
Owner

bvaughn commented Nov 25, 2017

If any of you leaving +1 comments would be interested in contributing a fix for this issue, I'd welcome the help. 😄

@OriR
Copy link
Contributor

OriR commented Jan 7, 2018

@bvaughn I'd be happy to try and fix this!
As I'm not that familiar with the code, I would appreciate it If you could point me in the right direction 😄

@bvaughn
Copy link
Owner

bvaughn commented Jan 7, 2018

I'd welcome a fix, @OriR!

I don't really have anything to point you at though, other than Grid (which List uses internally) and CellMeasurer.

@OriR
Copy link
Contributor

OriR commented Jan 8, 2018

Ok then, I'll start digging around and see what I can find :)
I'll post here any updates 👍

@OriR
Copy link
Contributor

OriR commented Jan 8, 2018

@bvaughn I opened a PR fixing this issue :)

@Miindaugas
Copy link

Miindaugas commented Jan 9, 2018

Yes same problem Grid is not initialized correctly, waiting for fix.

Right now i use workaround.

    componentDidMount() {
       this.cache.clearAll();
       this.list.forceUpdateGrid();
    }

@bvaughn
Copy link
Owner

bvaughn commented Jan 13, 2018

I plan to release an update this morning with this fix.

@ngwing
Copy link

ngwing commented Apr 5, 2018

Has this bug fixed?

@JunlinZhu-Tommy
Copy link

still suffering on this issue.

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

Successfully merging a pull request may close this issue.

10 participants