Skip to content

Scroll to an exact position when clicking the scrollbar track doesn't work in case of variable row heights and isVerticalScrollExact = true  #711

@daniela-mateescu

Description

@daniela-mateescu

When having variable row heights by setting rowHeightGetter property and isVerticalScrollExact = 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 #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() to initializeRowHeightsAndOffsets()

Steps to Reproduce (for bugs)

You can reproduce this by simply checking out the DynamicRowHeights example, specifying isVerticalScrollExact={true}, and scrolling exactly once by clicking on the vertical scrollbar area.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions