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

What is Framer? Join the Community
Return to index
Cemre Güngör
Posted Apr 11 - Read on Facebook

Two questions:
1- How would you have a draggable layer animate to another position while my finger is still down (I can't drag it until the animation is over), then resume dragging from its new location? Currently when I resume dragging, the object just snaps
2- After changing the dragging speed mid-drag, the layer jumps (I think the logic is starting_position + change * speed and it still has the old starting_position and change values). Any way around this?


Josef Richter

1 maybe having transparent draggabletwo layers and moving your target layer based on their values?
2 maybe not changing the drag speed but rewriting the position when reaching the treshhold you need? or again, a draggable transparent wrapper, and changing the position of sublayer within that wrapper?
Maybe I just don't understand what you mean, so ignore me if it's bullshit :-)

Koen Bok

I was playing around with this and I think the easiest way is to override updatePosition on draggable where you can add your custom offset before updating the actual layer position.

Cemre Güngör

Koen Bok I figured it out, I reset the drag offset / starting position by looking at the last event in the event buffer, but this uses private methods :(

Cemre Güngör

Can you check out the code and tell me if there's a non hacky way to do this?

Read the entire post on Facebook