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

Mousewheel scrolling does not scroll completely in containers missing vertical scrollbar #3772

Closed
swalters opened this issue Jun 12, 2015 · 8 comments
Assignees
Milestone

Comments

@swalters
Copy link
Contributor

@c0bra if you could take a look at this, I'd appreciate it. I'm baffled.

In 203_pinning

  1. Scroll to bottom using vertical scrollbar. Last row is ID 499
  2. Now use mouse wheel to scroll up and down in left container. Last row Id is 496.
  3. Do the same in Body container. Last row Id is 496.
  4. Do the same in right container. Last row Id is 499
@swalters swalters added this to the 3.0 milestone Jun 12, 2015
@swalters
Copy link
Contributor Author

You might want to merge #3769 before looking at this, but it gets the same results with or without it.

@c0bra
Copy link
Contributor

c0bra commented Jun 18, 2015

Note: this happens in Chrome, Firefox, and IE10. Doesn't seem browser-related.

@c0bra
Copy link
Contributor

c0bra commented Jul 6, 2015

Note: The margin-top that gets set from scrolling the right-most container (the one with the scrollbar) is 60px more than the others. 60px == two rows.

@c0bra
Copy link
Contributor

c0bra commented Jul 6, 2015

Apparently scrollTop is coming in 100px longer for the container with the scrollbar.

@c0bra
Copy link
Contributor

c0bra commented Jul 7, 2015

I thought maybe that the mousewheel handler was allowing an extra call to fireThrottledScrollingEvent() on the scrollbar container, but it isn't so.

It's just a normal scroll event I think...

@c0bra
Copy link
Contributor

c0bra commented Jul 7, 2015

Note: It may be because the scrollbar-less container doesn't fire scroll events. So the one with scrollbars is able to fire an extra event to get to the bottom that the other ones can't.

We may need to somehow manually set the scrollTop to the max if we're at/past 100% and not at the max scroll distance (canvas height - viewport height)

@c0bra
Copy link
Contributor

c0bra commented Jul 14, 2015

The problem is that containers that have overflow: scroll will scroll to the bottom
containers that have overflow: hidden won't
They will stop ~ 100px short

@c0bra
Copy link
Contributor

c0bra commented Jul 14, 2015

Looks like we've been calculating scroll percentage wrong. The max scroll length should match the scroll height of the viewport but it's off by the height of the scrollbar, which causes the scroll percentage to go BEYOND 100%.

The mousewheel handler prevents firing this > 100% scroll event, and thus the container does not scroll.

c0bra added a commit that referenced this issue Jul 14, 2015
Containers that have overflow: hidden set are not able to naturally scroll
to 100%, because they cannot handle native scroll events; only mousewheel. It's a long discussion; see #3772 for notes.

This change catches a mousewheel event that should put the container at
the max scroll position (basically scrollHeight - offsetHeight) and
manually sets the scrollTop to that amount.

Fixes #3772
@c0bra c0bra removed the in progress label Jul 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants