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

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

The new "layer.draggable.momentum" (enabled by default) might brake "layer.on Events.DragEnd" in SOME CASES, returning a ScriptError when a draggable is released without momentum. Funnily enough, releasing the said layer with momentum will still work fine!

I'm talking about this common construction:

layer.draggable.enabled = true
layer.draggable.speedX = 0
# layer.draggable.momentum = false # <- fixes the problem

layer.on Events.DragEnd, ->
.....if layer.y > 100
..........doSomething()
.....else
..........doSomethingElse()

It's a strange bug/feature and took me quite a while to figure it out, so I thought it would be nice to give you an headstart on your debugging process.

Unfortunately, I wasn't able to replicate/confirm this behavior in an isolated case, so instead of a bug it could just be the result of my shaky programming ;)

Nonetheless, I'm not sure if draggable.momentum should be enabled by default. Somehow, it just feels wrong in most cases anyway. What do you guys think?

6 Comments

Fran Pérez

I've noticed this as well.

Koen Bok

So, in the ScriptError, what does the console actually say? I should be able to fix this.

Koen Bok

Ah, so I think this is fixed already. Check File > Update Framer for your project and it should be gone.

Marc Krenn

nope, Koen, unfortunately it still returns the same ScriptError

Koen Bok

Ok, then I missed something. I'll look into it after Kingsday.

Read the entire post on Facebook