I have a problem (maybe a silly problem ;-)) regarding a variant of a component. The situation is as follows: I want to open an overlay with a press on a button. The Button is a component with three variants “Default”, “Hover” and OnClick. This variants represents the states of the button. I have designed the interaction in the way that while hovering on variant “Default” the component should change to variant “Hover” and while pressing the variant “Hover” it should change to “OnClick”.
In most scenarios this works (e.g. navigating to another frame). But when I want to open an overlay, after opening the overlay the component does not change back to “Default” and remains in the state “OnClick”.
What have I overseen? Is there an issue in the component / a missing interaction?
Here is the Figma-File: https://www.figma.com/file/iUECcs8UZimjSHcai7Jbsv/ModalOpenendByButton?type=design&node-id=0%3A1&mode=design&t=rIuvgGfvECTI0ipb-1
Sorry if there is already a similar topic I have overseen.
Thanks and best regards
Hey there, sorry to hear this is happening. We’re having some difficulty trying to imitate and solve the behavior here.
At first glance, it seems that with the overlay open, the button recognizes that it’s still being “pressed” which is why the OnClick button variant remains. But when the overlay is closed, there’s no variant interaction to instruct the button to return to its default state:
Thanks for answering. Is there a better way to design the component (with a hover and onclick effect)?
As a workaround I tried to double the pages. The second page is a copy of the first page. But when pressing the button, I first navigate to second page and then open the overlay in the second frame. And when pressing the button in the second frame, I first navigate to the first frame and than open the overlay. I have tested it, it works quite well (see Figma link above). But with additional work in designing and maybe less performant. Maybe there is a better way?