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

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

Closed
daniela-mateescu opened this issue Dec 20, 2023 · 3 comments
Assignees
Labels

Comments

@daniela-mateescu
Copy link
Contributor

daniela-mateescu commented Dec 20, 2023

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.

daniela-mateescu pushed a commit to famiprog/fork-fixed-data-table-2 that referenced this issue Dec 20, 2023
@daniela-mateescu daniela-mateescu changed the title Scroll to an exact position when clicking the scrollbatr track doesn't work in case of variable row heights and isVerticalScrollExact = true Scroll to an exact position when clicking the scrollbar track doesn't work in case of variable row heights and isVerticalScrollExact = true Dec 20, 2023
@daniela-mateescu
Copy link
Contributor Author

Hello!

I have done a fix for this in: #712.
Please let me know if it looks good to you.

Thank you.

@pradeepnschrodinger
Copy link
Collaborator

Nice! Thanks for filing and putting a PR so quickly.

cc: @karry08

@pradeepnschrodinger
Copy link
Collaborator

I'm closing this out since the fix was released with v2.0.6.

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

No branches or pull requests

3 participants