Skip to main content
Solved

How can I change the variant AND add an overlay?


Gjeneta

I have a button, which on click changes to another variant. However, on click I also want to open an overlay. So, the problem is that at the moment this is not possible since I can only add one “on click”-interaction.

Does somebody have an idea, how I could do both?

Best answer by Klesus

I changed some things that makes it seem to behave as intended, but personally I don’t like the setup on a conceptual level.

Figma – 14 Mar 22

There was a “pressed” state that was unused which I fixed, and to open the overlay I put the trigger inside the component set, which is why I don’t like it. But it works.
I also added an “on mouse leave” which resets the flow.

View original
This topic has been closed for replies.

7 replies

Adam_Przewoski

Hey Gjeneta, you can try experimenting with overriding interactions of your button component on an instance level, using triggers such as “Mouse down”, which can be combined with “Click”.

While the workaround I managed to come up with is not perfect, as the button never returns to its initial state upon closing the overlay, at least it gets half of the job done. 😉

Please, see this file to examine first the interactions set up on the main component level, and then the overrides I applied on the instance level, in the “Frame 1”.

Figma – 12 Mar 22

Klesus
  • 237 replies
  • Answer
  • March 14, 2022

I changed some things that makes it seem to behave as intended, but personally I don’t like the setup on a conceptual level.

Figma – 14 Mar 22

There was a “pressed” state that was unused which I fixed, and to open the overlay I put the trigger inside the component set, which is why I don’t like it. But it works.
I also added an “on mouse leave” which resets the flow.


Gjeneta
  • Author
  • 3 replies
  • March 14, 2022

Hey! Unfortunately I can’t have a look, could you maybe change the setting so that I can view? 😃


Klesus
  • 237 replies
  • March 15, 2022

Oops. Accidentally deleted the file. I’ve restored it now.


Gjeneta
  • Author
  • 3 replies
  • March 15, 2022

Ah, thank you very much! 🤗


Gjeneta
  • Author
  • 3 replies
  • March 15, 2022

Thanks a lot for the example! ☺️


  • 0 replies
  • April 14, 2022

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings