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

What is Framer? Join the Community
Return to index
Samarth Bahuguna
Posted Oct 04 - Read on Facebook

If I change the constraints of a draggable layer in code such that the layer now lies outside it's permitted region, is there a function to push it within it's new constraints?

After changing constraint values, I'm having to drag it very slightly and let go to make it slide into it's new region. I think this should either happen automatically on changing the draggable region, or there should be a method to reposition the draggable layer if it's outside bounds. Thanks for any help!


Niels van Hoorn

I've looked into this a bit, and don't see an easy way to currently do this, but I agree that is would be a sensible thing to have. Would you be so kind to create a new issue for this in our public issue tracker?

Samarth Bahuguna

Sure, I'll do that. I solved it by using constraintsOffset after changing the constraint values, and shifting the layer by that amount. But it'll be good to have this as a feature.

Read the entire post on Facebook