Closed daniela-mateescu closed 8 months ago
Hello!
I have done a fix for this in: https://github.com/schrodinger/fixed-data-table-2/pull/712/. Please let me know if it looks good to you.
Thank you.
Nice! Thanks for filing and putting a PR so quickly.
cc: @karry08
I'm closing this out since the fix was released with v2.0.6.
When having variable row heights by setting
rowHeightGetter
property andisVerticalScrollExact = true
and clicking once on the vertical scrollbar area, the scrollbar thumb isn't jumping exactly where the click happened.This was a known issues at the time the "isVerticalScrollExact" feature was introduced: in https://github.com/schrodinger/fixed-data-table-2/pull/701
Possible Solution
The cause of this is that the actual row heights are requested when the first scroll event happens. But in order for the scrollbar to work correctly when is clicked, the exact row heights should be computed before scrollbar initial configuration, in order for the
ScrollbarComponent.contentSize
to be exact.So the solution is to move the code that computes and stores the actual row heights from
scrollTo()
toinitializeRowHeightsAndOffsets()
Steps to Reproduce (for bugs)
You can reproduce this by simply checking out the
DynamicRowHeights
example, specifyingisVerticalScrollExact={true}
, and scrolling exactly once by clicking on the vertical scrollbar area.