polymer on mobile - prevent scroll to refresh

81 views
Skip to first unread message

Ged Wed

unread,
Oct 2, 2015, 5:50:10 AM10/2/15
to Polymer
With SPA on mobile, its easy to accidently swipe down, hit the top and force a refresh of the whole AP application. This is a pretty bad usability bug.

So i found some code to prevent it. Works on Android. 
Can someone verify it works on IOS ?

The jsbin is here:

Ideally i see two thing to do next:
1. Make it a polymer behaviour
2. There are some Elements where you want to reload on scroll-to-refesh swipe, but only if the user is swiping on that specific element. It can then do its own ajax call for update.

I am wondering if the Polymer devs have thought about this as a behaviour, and are planning to work on this anyway and officially support it.

Eric Bidelman

unread,
Oct 7, 2015, 2:33:40 PM10/7/15
to Ged Wed, Polymer, Daniel Freedman
+1 This would be a useful pattern to codify. 

Dan have we thought about componentizing this pattern as a behavior? 

Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/e5cb3894-0bd5-4c4b-9e04-fa3360125f6c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Daniel Freedman

unread,
Oct 7, 2015, 3:19:27 PM10/7/15
to Eric Bidelman, Ged Wed, Polymer
The "prevent scrolling" behavior is already present as `element.setScrollDirection('none')`. You probably don't want to prevent scrolling on the whole page, so it is an element-by-element behavior.

I'd like to get some feedback from Chrome's Input team for more elegant solutions that don't require whole-document touch handlers, which jank scrolling.
Reply all
Reply to author
Forward
0 new messages