Tuesday, March 25, 2014

Default ScrollPanel disables iOS pinch zooming, how to disable touch support by default?

The default ScrollPanel in GWT includes touch support, but this disables pinch zooming on iOS devices. The issue is reported for MGWT here:


You can work around this by disabling touch support on your ScrollPanel, so I've done this in a MyScrollPanel, something like this:

public class MyScrollPanel extends ScrollPanel {
   
public MyScrollPanel() {
       
// disable touch scrolling on iOS, as it affects pinch zooming
       
final String platform = Navigator.getPlatform();
       
if (platform.contains("iPad") || platform.contains("iPhone") || platform.contains("iPod")) {
            setTouchScrollingDisabled
(true);
        }
   
}
}


This works well when I have control over the creation of the ScrollPanel, but sometimes I don't, like when DataGrid creates a CustomScrollPanel internally. Is there a way to turn off touch scrolling support globally somehow? Maybe deferred binding and replacing the ScrollPanel class would work?

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment