Figma Support Forum

Reverse action on second click

Is there a way to create a reverse action on second click of the same element? For example i want to close the popover by clicking the same avatar icon
Screen-Recording-2021-07-30-at-08.45

From the overlay, add the click trigger with the action “Close overlay”.

I want to place the action on the same “avatar” element, so in this case i can’t create the “Close overlay” action

Overlays don’t work like that, when the overlay is open you can only interact with it, not what’s below. Why do you want to place the close action specifically on that element? What’s the difference?

okay… let’s say i want to recreate the same dropdown element from your website :smiley:
Screen-Recording-2021-07-30-at-10.41
is this possible to achieve exactly the same result …to close dropdown by clicking the arrow …not the dropdown itself, not the space around …only the arrow.

Of course. Set the “Close overlay” action to the arrow which is a part of the overlay.

Nope, for me it’s not a part of the overlay (dropdown/popover or whatever it is), i want it to be a separate element. And for me it’s a minus and kinda strange that “close overlay” interaction works for itself only
image
would be good if it will work like “open overlay” …both with itself and other components like this
image

So as i see it just has its own logic and functionality, maybe not what i’m looking for but it is what it is)) anyways thank you Gleb for your replies, much appreciated mate :raised_hands:

But it needs to be in order for this to work. :slight_smile: You can create a 0.1% transparent rectangle in that place in the overlay if you don’t want to overlay the icon.

yeah it can work, not bad trick …but just a trick))) …but i’d like to see more native flexible functionality) i actually got what needed by using interactive components, just created two variants with open and closed popover states, but anyways it is still not the optimal solution in my opinion

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.