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

What is Framer? Join the Community
Return to index
Jordi Martinez Ortega
Posted Mar 07 - Read on Facebook

is there anyway I can specify if I want the events to be detected on the 'capturing phase' rather than on the 'bubbling phase'?

That's how I would do it on javascript?
element1.addEventListener('click',doSomething2,true)

the idea is to stop events (TouchEnd, etc) from propagating to sublayers just by capturing and stopping the event at the parent layer level.

4 Comments

Ian McClure

I know Framer does have event listeners.

layer.addEventListener 'event' , (event, layer) ->

I would think that you would need to have each layer listen for the touch event and set its superLayer to a temp variable then swap back when the TouchEnd triggers.

Hope that is helpful.

Jordi Martinez Ortega

It helps but it's kind of annoying. I found where Framer wraps the EventEmitterManager function to Layer._element and it would be as simple as adding a third argument (true) to the this.element.adEventListener. I wish there was a way I could decide if I want to pass that third argument or keep it false by default

Jordi Martinez Ortega

what I am looking for it's an easy way of invalidating any user event (touch) on a layer and all it's sublayers like UIView does with enabledUserInteraction

Jordan Robert Dobson

.ignoreEvents might work on subLayers are you dealing with dragging layers at all? What I had done before was when I get a TouchStart or TouchMove on a parent element I call a method that deactivates all children.

Read the entire post on Facebook