Skip to content
This repository has been archived by the owner on Mar 27, 2019. It is now read-only.

Android StockBrowser 4.0.4 scroll jitter when dragging without lifting finger (regression) (fix supplied) #780

Open
borhub opened this issue Sep 3, 2014 · 1 comment

Comments

@borhub
Copy link

borhub commented Sep 3, 2014

The change in #441 unfortunately degrades the drag-scrolling experience to the point of iScroll not being an acceptable solution to work around 4.0.4 Stock Browser's scrolling-div-related bugs for my team (e.g. on Galaxy S3 running the 4.0.4 Stock Browser).

A quick fix that enables both the transition cancellation, as well as smooth scrolling is to update the _transitionTime() method in the "isBadAndroid" section so that applies the non-zero transition time only when we're already in a transition that we need to cancel.

this.scrollerStyle[utils.style.transitionDuration] = this.isInTransition ? '0.001s' : '0s';

However, if we do only this, if the user then continues dragging (after tapping to cancel the transition) without lifting the finger, we still get the jitter. For that to go away, we need to do something like this

            this.scrollerStyle[utils.style.transitionDuration] = this.isInTransition ? '0.001s' : '0s';
            var that = this;
            setTimeout(function () {
                that.scrollerStyle[utils.style.transitionDuration] = '0s';
            }, 17);

Note this is very messy code potentially using the isInTransition property in a wrong way, not knowing implications, but it should illustrate a direction of a possible solution.

EDIT: we probably don't need to care about isInTransition at all, so this should be all that's needed:

if ( !time && utils.isBadAndroid ) {
    this.scrollerStyle[utils.style.transitionDuration] = '0.001s';
    setTimeout(function () {
        this.scrollerStyle[utils.style.transitionDuration] = '0s';
    }.bind(this), 17);
}
@borhub borhub changed the title Android StockBrowser 4.0.4 scroll jitter when dragging without lifting finger (regression) Android StockBrowser 4.0.4 scroll jitter when dragging without lifting finger (regression, fix supplied) Sep 3, 2014
@borhub borhub changed the title Android StockBrowser 4.0.4 scroll jitter when dragging without lifting finger (regression, fix supplied) Android StockBrowser 4.0.4 scroll jitter when dragging without lifting finger (regression) (fix supplied) Sep 3, 2014
@sculove
Copy link
Collaborator

sculove commented Mar 22, 2016

Great!. I also fix this issue like you.

sculove added a commit that referenced this issue Mar 23, 2016
- fix detect code for 'isBadAndroid'
- fix workaround code

ref #760, #441, #943, #927, #780
aisouard pushed a commit to Mappy/iscroll that referenced this issue Feb 22, 2017
- fix detect code for 'isBadAndroid'
- fix workaround code

ref cubiq#760, cubiq#441, cubiq#943, cubiq#927, cubiq#780
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants