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

What is Framer? Join the Community
Return to index
Marc Krenn
Posted Dec 09 - Read on Facebook

I've just tried out using 'draggable.directionLock' for the first time and to be honest, it was a bit of a letdown, or let me put it another way: It doesn't behave like I've expected it to:

* For some reason, the draggable layer doesn't move within it's threshold boundaries, which is kinda weird. Does anyone actually want/need that behavior?

* Once you've dragged the layer outside of the threshold, the direction stays locked, even if you're dragging it back into the threshold-zone. While this may be useful in some cases, I'd assume 95% of the time you'd lock the direction manually via 'draggable.*direction* = false'. Especially since a ...

* Change of direction is only possible if you let go and re-click/tap the draggable layer.

###

Gif: The top layer shows what I expected from 'draggable.directionLock*Threshold'

(I know, my straight dragging is a bit unfortunate - but believe me, once it lefts the 'zone' it is actually direction-locked :) )

###

What do you guys think?

7 Comments

Jordan Robert Dobson

From what I understand it's a threshold you set where as the item won't lock into a drag direction until that threshold is met... Also drag events won't fire either.

Jonas Treub

The direction lock comes in really handy when you combine for example a pagecomponent and scroll component like in the Medium example. If the direction lock would allow an offset in both x and y directions you would see a tiny edge of another page. Probably not what you want, right? http://framerjs.com/examples/preview/#medium-app.framer

Jordan Robert Dobson

Exactly. Or like in slack you want to scroll up and down not accidentally pull out the side trays.

Marc Krenn

I can see how the current implementation is super-useful when being combined with scroll- and pagecompenents ...

... but that's not was I was talking about ;)

Chris Camargo

...but that's what it was made for.

Marc Krenn

touché ;)

Marc Krenn

Well, I guess using directionLock outside of the context of scroll/pageComponent is not too common then, hehe.

###

Guys, don't get me wrong, I'm not saying it's useless or something in its current form - I just *expected* it to work differently in the context of vanilla-draggables (see example.gif).

Different context = different expectation.

Oh, and I still think my points I came up with in the opening post are still reasonable and worthy of being discussed. No one really responded to those so far. Thanks. :)

Read the entire post on Facebook