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

What is Framer? Join the Community
Return to index
Jordan Robert Dobson
Posted Aug 20 - Read on Facebook

Can anyone recommend a good way to ignore all events in a PageComponent?

I have a PageComponent that needs to sit as the topmost layer. Once a page in the page component is selected, I zoom inwards exposing content behind it in separate set of layers. I no longer want the pageComponent events to be triggered until I zoom back out.

I’ve tried disabling scroll… but it still gets triggered on a swipe, even though the pages don’t move with it. I’ve also tried ignoreEvents… but the swipe again still triggers a prev/next page action.

I need some other ideas. :/

Thanks in advance!

21 Comments

Joshua Tucker

Where are you setting the ignoreEvents? On the PageComponent itself or on its content?

Jordan Robert Dobson

Pretty much everywhere.

Stephen Crowley

Ughh what? To the chats gents!

Jordan Robert Dobson

Even when you can't scroll / drag... A drag an event gets fired apparently via velocity?

Cemre Güngör

Disable the draggable inside the pagecomponent?

Cemre Güngör

Nvm that won't work. I think this happened to me too. I had to patch the TouchEnd of the pagingcomponent

Cemre Güngör

I think you should add a conditional there and submit a patch

Jordan Robert Dobson

I haven’t tried that yet… but I’ll dig in here.

Jordan Robert Dobson

Cemre Güngör - I ended up figuring out what I needed to do: http://jrdn.io/cCVS

Jordan Robert Dobson

page.ignoreEvents = true
page.content.ignoreEvents = true
page.content.draggable.enabled = false

Jordan Robert Dobson

Thanks Cemre, Joshua & Stephen for taking a crack at this and guiding me towards the solution.

Stephen Crowley

Thank god that convo wasn't a comment chain, that was fun :)

Joshua Tucker

Jordan Robert Dobson Might be worth submitting as a re-think. If you ignoreEvents on component, it's ignores subLayers? Maybe I'm missing right this second why you would want to say leave some of them enabled? But that's a lot of ignoring to do haha.

Joshua Tucker

Stephen Crowley It's not too late.

Stephen Crowley

:)

Jordan Robert Dobson

Actually now that I look again… I might not need to mess with draggable just to let clicks pass through to elements under the pageComponent. I just have to hulk smash ignoreEvents on the pageComponent and content layer… but changing draggable does stop it from scrolling on me too so bonus!

It seems to me if we set page.ignoreEvents it should also set that on page.content and most likely set list.content.draggable.enabled too.

/cc Koen Bok

Daniel Rakh

Awesome solution Jordan. Is there anyway to disable say the horizontal swipe while still letting the page drag/scroll vertically?

Jordan Robert Dobson

I would look into the directionLock stuff... or speedX

Daniel Rakh

I'll check it out.

Jordan Robert Dobson
Jordan Robert Dobson

Make sure you apply it to content layer.

Read the entire post on Facebook