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

What is Framer? Join the Community
Return to index
Kai Pradel
Posted Feb 25 - Read on Facebook

Trying to figure out how to respond to an onClick event that doesn't automatically trigger an OnMouseLeave event for the underlying layer.

In regular JS this is achieved with event.preventDefault but that does not appear to work in this case. Any help is appreciated.

7 Comments

Radek Kyselý

Why not put the "view video" layer as a child of the underlying one?
Set the underlying layer as a ›superLayer‹ or ›parent‹ on "view video" :)

Kai Pradel

Radek, thanks for your feedback. I have added the button as a child to the overall Thumbnail. The result is somewhat better, but moving the mouse over the button still triggers an onMouseOut event.

https://dl.dropboxusercontent.com/s/c7mhbf5x3uqge4p/ECFD4BF2-27AE-4B24-8B86-460C8A57897C-808-00006AAF22E59B39.gif?dl=0

Kai Pradel

Does preventDefault just not work in Framer?

Orfeo Chen

Interesting. Waiting for a fix...

Lukas Guschlbauer

There's a "ignoreEvents" boolean! Maybe this would help!

Kai Pradel

Ok, so apparently you can use "mouseenter" and "mouseleave" as events that don't swallow the underlying event. Combination of making the button a child of the thumbnail and using this event did the trick.

Swapnil Borkar

Harsha Kausthubh Future reference for our cards.

Read the entire post on Facebook