gwtproject / gwt

GWT Open Source Project
http://www.gwtproject.org
1.52k stars 377 forks source link

Touchscroll with Chrome in hops on "longer scrolling" with Windows 10 tablet mode #9585

Open TatuLund opened 6 years ago

TatuLund commented 6 years ago

GWT version: 2.8.2 Browser (with version): Chrome (#63.0.3239.108 and latest canary #65.0.3299.0. Apparently all Chrome 56+) Operating System: Windows 10, tablet mode

Description

From 56+ Chrome has been changed in the way that TouchScroller.java no longer works properly with Windows 10 tablet mode devices. This can be seen e.g. in Vaadin8 application when using touch scroll with Chrome in Panel, it hops on "longer scrolling".

Steps to reproduce

Steps to reproduce the problem:

  1. Take a Win10 Touchdevice
  2. Open url: http://vaadindemo-env.eu-central-1.elasticbeanstalk.com/ui
  3. Touchscroll to "39: hello world!<-- try to stop exaclty here"
  4. Take your Finger away
  5. Browser Jumps! Scrollable Part (copied from: https://bugs.chromium.org/p/chromium/issues/detail?id=796103 )
Links to further discussions

There has been proposal to fix this behavior already in 2013, but for some reason patch has not been accepted.

Link to the patch here: https://groups.google.com/forum/#!topic/google-web-toolkit-contributors/1RcryRnpLUs

At quick glance this approach is correct direction (ref. https://bugs.chromium.org/p/chromium/issues/detail?id=796103 "Looks like the page is trying to cancel browser scrolling by canceling (preventDefault-ing) document level touch events, which is no longer allowed (from Chrome 56)")

https://groups.google.com/forum/#!topic/google-web-toolkit-contributors/1RcryRnpLUs

niloc132 commented 6 years ago

That patch was merged, it can be seen at https://gwt.googlesource.com/gwt/+/054ddf5a3902047935bf2bcf251398176f0bfd03%5E%21/. Are you sure that's the right in-progress patch? The date on it is 2011, but you said 2013, so perhaps you linked the wrong discussion/patch?

TatuLund commented 6 years ago

Sorry my bad. I miss read the date. I also compared the diff and the current code and the changes really seems to be in current code. So this brings up question, why this patch has not been sufficient. I am looking especially to lines 689-690, should that preventDefault be removed?

TatuLund commented 6 years ago

@niloc132 Have you checked my last question about lines 689-690, should that preventDefault be removed?

niloc132 commented 6 years ago

I haven't spent time looking into this, no - you had initially done some research that seemed to point to a fix being already ready to go, but that no longer seems to be the case. If you have a fix that might work, I'd be happy to serve as a reviewer, but I'm afraid I don't myself presently have time to independently come up with a fix. If you'd like me to dedicate some time to this directly, shoot me an email at colin@vertispan.com and we can discuss outside this ticket.

zbynek commented 1 year ago

TouchScroller uses this for version detection:

/**
   * Check if the user agent is android 3.0 or greater.
   * 
   * @return true if android 3.0+
   * 
   */
  private static native boolean isAndroid3() /*-{
    var ua = navigator.userAgent.toLowerCase();
    return /android ([3-9]+)\.([0-9]+)/.exec(ua) != null;
  }-*/;

which is clearly wrong for Android 10 (but will be correct again with Android 30 🤷 ). Since the whole point of the class is solving a problem that does not exist since Android 3 (released 2011), maybe it's time to just delete it.