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

What is Framer? Join the Community
Return to index
Moritz Habenbacher
Posted May 02 - Read on Facebook

Hi there,

I’ve just started my first Framer project. Now I’m struggling with an onClick-Event behavior I don’t understand.
There is a layer with an onClick-Event and a child layer with an onClick-Event too. However, the onClick-Event of the child layer also triggers the event of the parent layer. Could someone give me a hint how to prevent this behavior? 🙂

1 Comments

Andreas Wahlström

it's called bubbling and is a pretty common issue when dealing with dom events. in framer you'd do something like this:
child.onClick (e) -> e.stopPropagation()

here's an article explaining how and why it works: http://javascript.info/bubbling-and-capturing

Read the entire post on Facebook