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

What is Framer? Join the Community
Return to index
Chris Bindloss
Posted Jan 09 - Read on Facebook

Hey all, is there a on blur event for an element? In other words, how can I trigger an event for a layer when anything but that layer is clicked?

2 Comments

Juan J. Ramirez

It would help if you show what you're trying to do.

Are you trying to create a behavior to dismiss a foreground layer (like a modal or a contextual menu)?

Because if that's the case you can create two new layers, one for your menu/modal and one transparent layer beneath the menu layer...
That layer won't affect anything visually but allows you to trigger an event when anything but the focus layer is clicked.

Chris Bindloss

I'm making a form and wanted to create a class for dropdowns. I suppose when you click the select I could create a new layer that sits behind the select and spans the entire device screen, and could just destroy it when you click it.

Read the entire post on Facebook