-
Notifications
You must be signed in to change notification settings - Fork 10
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
Clarify whether overscroll/scrollend events are fired for programmatic or instant scrolls #4
Comments
I wrote a case for scrollEnd. It seems touch scroll and keyboard scroll on Mac are different. So if the event is fired for programmatic scroll, on Mac, it might still be in a scroll animation after receiving scrollEnd event. Or maybe we can find a way to indicate which scroll has ended? For instance, add scroll type: user or programmatic? |
cc @mustaqahmed and @flackr Hi, I'm working on a test of fire scrollend event for the combination of user scroll and programmatic scroll. The spec seems not clear for this situation. Should we clarify whether we should fire scrollend event for each scroll, or just fire one scrollend event? |
To be clear, you're saying what happens if a user scroll is interrupted by a programmatic scroll or vice versa right? I think it depends a lot on the use cases and forgive my naivety as I'm still catching up on the rationale for adding scrollend. I can imagine a couple major use cases:
In case 1, the end of a programmatic scroll is somewhat special as you could imagine there's some action that is triggered by completion of the scroll and wouldn't need to delay on subsequent scrolls. However, if there is a subsequent scroll triggered the developer may no longer want to trigger the effect. In case 2 however, I don't think the developer would want to initiate the action (e.g. refresh a stream, load an item) if there were more scrolling happening, as some other scrolling has interrupted the user's expressed intent. I don't think the developer has a good way of knowing whether more scrolling is coming if we sent multiple scrollend events right? |
Yes, and also including the cases the user scrolling is not stopped but continue to perform scrolling after programmatic scrolling, like the momentum scrolling on Mac and the pressing scrollbar scrolling.
Hmm, yes, make sense. I guess web developer would expect scrollend event fires when the element actually stops scrolling. It fires two scrollend events in my local WebKit patch:( It seems easier to implement. But I think combining the scrollend events is reasonable to me. I guess it is not limited in user scrolling + programmatic scrolling scenario. Only one scrollend event is fired in any scrolling combination scenario. Right? |
Right, exactly! I think that it would be too difficult to use scrollend if it were fired at times when there still is more scrolling queued (just by a different scrolling mechanism). |
cc @cathiechen
Authors can use various JS APIs e.g. Element.scroll() to scroll a view. They can specify the scroll behavior to be "smooth" (i.e. animated) or "instant". Moreover, if an animated user scroll is in progress, it will be interrupted by the JS call.
The text was updated successfully, but these errors were encountered: