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

Scrolling will jump when scrolled to bottom and selecting something #170

Open
ckosmowski opened this issue Dec 17, 2014 · 2 comments
Open
Labels

Comments

@ckosmowski
Copy link
Collaborator

The Scrolling of the grid will jump if:

1.) The grid has a horizontal scrollbar
2.) The grid is scrolled all to the bottom
3.) An entry is selected in the grid

The scrolling will jump up exactly for the height of the horizontal scrollbar.

I think i found the problem already but i don't know how it can possibly be fixed.

Please see the Method updateRowCount():

if (th === 0 || scrollTop === 0) {
    page = offset = 0;
} else if (oldScrollTopInRange) {
    // maintain virtual position
    scrollTo(scrollTop + offset);
} else {
    // scroll to bottom
    scrollTo(th - viewportH);
}

In the very last case which applies here, scrollTo() is called.

Now if i look at scrollTo():

scrollTo = function (y) {
    y = Math.max(y, 0);
    y = Math.min(y, th - viewportH + (viewportHasHScroll ? window.scrollbarDimensions.height : 0));

    var oldOffset = offset;

i noticed that there already seems to be a fix for the above mentioned problem. But it does not apply because the passed value of y is always less than the result of the expression th - viewportH + (viewportHasHScroll ? window.scrollbarDimensions.height in this specific case.

@EvHaus
Copy link
Owner

EvHaus commented Dec 17, 2014

I'm unable to reproduce this one. How do you execute step 3? Do you click on the grid somewhere?

@EvHaus EvHaus added the bug label Dec 17, 2014
@ckosmowski
Copy link
Collaborator Author

Yes on a row. But i use rowBasedSelection.

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

2 participants