schrodinger / fixed-data-table-2

A React table component designed to allow presenting millions of rows of data.
http://schrodinger.github.io/fixed-data-table-2/
Other
1.29k stars 290 forks source link

Row heights are not evaluated when table is re-rendered - scrollbar is missing #9

Closed 3cooper closed 7 years ago

3cooper commented 8 years ago

My table has dynamic row heights. When I change the height of a cell and re-render the table, the scrolling on the table is broken. If I expand the same row again, scrolling is restored.

Expected Behavior

I would expect that after re-rendering the table that the scrolling would work.

Current Behavior

The row expands but the scrollbar is removed which prevents scrolling.

Possible Solution

It appears that _calculateState() is not getting the actual row heights from the rowHeightGetter methods when it calls

var scrollContentHeight = this._scrollHelper.getContentHeight()

At this point it is getting the height of the rows by checking the rowHeight property on the table. I see in _calculateState() there are other calls that eventually call this._scrollHelper._updateHeightsInViewport() to properly get height.

Steps to Reproduce (for bugs)

https://jsfiddle.net/3cooper/9dayaac8/

Context

This prevents me from using this table in a solution that we have designed around it.

Your Environment

KamranAsif commented 8 years ago

The scoller is getting rendered before the rows are. The app then updates its content height after render, but doesn't trigger and update on itself.

Might want to take this opportunity to correct data flow from scroll helper..

KamranAsif commented 7 years ago

Marking this as a duplicate of https://github.com/schrodinger/fixed-data-table-2/issues/25