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

What is Framer? Join the Community
Return to index
Johnny Garces
Posted Apr 06 - Read on Facebook

hi framer fam,

I have a question on preventing some default actions. In my case, I have an overlay that is at first hidden but then appears along with social media icons when user clicks on the "share button".

This overlay then disappears along with the social icons when the user clicks on anywhere within the overlay. The problem is that I don't want the overlay to disappear when user clicks on the social icons. The overlay should not be hidden upon clicking on the social icon- only if it's clicked within any area of the overlay except for the icons.

Here's a link to the prototype- would appreciate any feedback on my code as well :)

2 Comments

Steve Ruiz

Easy fix, though this kind of event bubbling can be tricky in general. You can add 'item.ignoreEvents = false' to your socialIcons items and that will fix this problem. A second way would be to use 'item.onClick -> event.stopPropagation()', though this doesn't always play as well with the rest of Framer.

Johnny Garces

thanks for sharing, event.stopPropagation sounds a lot like event.preventDefault- def makes sense :)

Read the entire post on Facebook