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

What is Framer? Join the Community
Return to index
Cemre Güngör
Posted Jun 11 - Read on Facebook

Is there a way to make Click events "bleed through" layers to the ones beneath? Both the layer on top and the layer under it would receive the click event.

14 Comments

George Kedenburg III

What's the use case for this?

Morgan Knutson

Remove pointers events on embedded layer but tie events to both?

Joshua Tucker

Emit a click event for the layer below?

Jordan Robert Dobson

I've never found a way to do this except detecting if a point was inside it's view. Supposedly there is this method: https://developer.mozilla.org/en-US/docs/Web/API/Document/elementFromPoint

Allan Grinshtein

Have you tried forcing the element to inline CSS with pointer-events:none; ?

Johannes Eckert

I could see capturing the click event on a background layer and then checking if the coordinates of that click was inside the bounds of one or both layers

George Kedenburg III

I'm still confused why anyone would ever need to do this...

Cemre Güngör

I have two layers I want to drag at the same time

Cemre Güngör

George come by my desk tomorrow?

Johannes Eckert

each layers call a function that keeps the movement in sync, and they are called from one of the layers and keep the other layer in sync.

George Kedenburg III

^this

Jordan Robert Dobson

Yeah Johannes Eckert - I've gone that route too.

Jordan Robert Dobson

Basically I've captured from a superlayer that each element is a part of and then detected if the point is inside its bounds. Or you press and drag and do an on:"change:x" or similar to fire events or call other methods.

Joshua Tucker

Johannes Eckert What Jordan Robert Dobson just said :). Using the event "change:[whatever]" is a great option I use often.

Read the entire post on Facebook