koenbok / Framer

Framer - Design Everything
https://framer.com
MIT License
5.85k stars 477 forks source link

Two PageComponents can interfere with each other if velocityThreshold == 0 #562

Open onnlucky opened 6 years ago

onnlucky commented 6 years ago

If you have two PageComponents on screen (see code below), then:

unexpected: the top one scrolls by one page

The culprit in this case is velocityThreshold: 0. But at a deeper level, somehow the first page components reacts to events that are never meant for it. It seems DragSessionEnd https://github.com/koenbok/Framer/blob/23da2bff1c61da9405ed324f969da981dff888eb/framer/Components/PageComponent.coffee#L35


page = new PageComponent
    width: Screen.width
    height: 100
    velocityThreshold: 0 # setting this to anything else > 0 works

for i in [0..10]
    new Layer
        width: 100
        parent: page.content
        x: i * (100 + 8)

page2 = new PageComponent
    width: Screen.width
    height: 100
    y: 200