How can I change the variant AND add an overlay?

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?

1 Like

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. :wink:

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”.

1 Like

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

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.

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

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

1 Like

Ah, thank you very much! :hugs:

Thanks a lot for the example! :smiling_face:

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