This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Johannes Eckert
Posted Mar 10 - Read on Facebook

is there a preventDefault() to use with Events.DragMove to avoid a mobile browser from scrolling/rubberbanding the page?

8 Comments

Cemre Güngör

That doesn't do the trick?

Cemre Güngör

Try prevent default on drag start?

Gary Jacobs

Thanks Dave Marchuk, please let us know once you have it. This is something I've been seeking for a while now.

Johannes Eckert

thanks! that sounds you will prevent scrolling the viewport in general, which may make sense for some prototypes.
if you just want to not have the viewport scroll with the drag movement, Cemre's tip on DragStart works for me:

view.draggable.on(Events.DragStart, function(e) {
e.preventDefault();
});

Johannes Eckert

thanks Cemre!

Gary Jacobs

Hi All. I'm still having no luck with not getting my view to cease scrolling (iPhone 5s). Here is my code. Any ideas.

draggable = new ui.Draggable(mailList);

mailList.on(Events.TouchMove, function(e) {
e.preventDefault();
var distance;
distance = {
y: Math.abs(mailList.y - position.y)
};
draggable.speed.x = 1 - Math.min(distance.x, boundRadius) / boundRadius;
return draggable.speed.y = 1 - Math.min(distance.y, boundRadius) / boundRadius;
});

Johannes Eckert

Try maillist.draggable.on(

Gary Jacobs

Hmmm still no joy and it broke the resistance function. I'll keep trying. If anyone has the time to fork it for me, that would be greatly appreciated.
https://github.com/GaryonGit/Pull-to-Refresh

Read the entire post on Facebook