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

What is Framer? Join the Community
Return to index
Josh Ackerman
Posted Mar 22 - Read on Facebook

Hello,
How could I restrict the area a user can drag something in? I would like to prevent a draggable object from leaving screen boundaries. I tried something like this (for each edge of screen):

layerA.on Events.TouchMove,->
if layerA.x < 0
layerA.x = 0

Thanks.

2 Comments

Andreas Wahlström

Maybe try LayerA.draggable.maxDragFrame = Framer.Device.screen.frame

Josh Ackerman

Thanks that worked.

Read the entire post on Facebook