Figma Support Forum

Adding on click Overlay action resets the interactive component state

I have a use case, where I have to show a toast message when I toggle a button. For the buttons, I made the button an interactive component and used on click change to toggle the button’s design.

I created the toast message component which overlays when the button is clicked and after delay closes the overlay going back to main screen.
But when it goes back to the main screen, the button is back to the default state instead of the clicked state.
Which should have been this:

For the case of simplicity, consider that you are implementing light and dark theme and when you toggle a theme a toast message appears for a few seconds

Is this a bug? Any workarounds other than transitioning to a new frame?