Inconsistent swipe on android webview

Inconsistent swipe on android webview

For quite some time I have been unable to get the swipe to work on android webview. It would sometimes work and sometimes not. I decided to look into the jquery.mobile source to see what was going on.

The main issue was a lot of the time when starting a swipe the line
Math.abs( start.coords[ 0 ] - stop.coords[ 0 ] ) > $.event.special.swipe.scrollSupressionThreshold

would fail early, causing scrolling to occur.
Math.abs( start.coords[ 0 ] - stop.coords[ 0 ] )  would often be very low numbers of 3 -> 8.

Not sure what the original design was here. Was it assumed events would not come it that quick
to trigger this ? This triggered even though I was swiping fast. 

I have set scrollSupressionThreshold = 5 in my code and that helps but then scrolling is an issue.

I found better results when I did the following.

Starting on line 4077 we have

// prevent scrolling
if ( Math.abs( start.coords[ 0 ] - stop.coords[ 0 ] ) > $.event.special.swipe.scrollSupressionThreshold ) {
event.preventDefault();
}

I changed this to

// prevent scrolling
if ( stop.time - start.time < $.event.special.swipe.durationThreshold &&
    Math.abs( start.coords[ 0 ] - stop.coords[ 0 ] ) > $.event.special.swipe.scrollSupressionThreshold ) {
   event.preventDefault();
}
else {
     // Reset the context to make way for the next swipe event
    $.event.special.swipe.eventInProgress = false;
}

I did this as when the durationThreshold time is up I feel it should assume scrolling ?
Also when we start scrolling we should mark the swipe event done. 
This seems to help scrolling when scrollSupressionThreshold is low.

I have only started to look at the jquery source in the last hour for the first time so may be well off base here.
If there is a better solution please let me know.

On my Android testing the swipe now works consistently and scrolling seems to be easy as well.

Thanks