Typical case, can be replicated with the Playground file too, if you just add a “while pressing”-variant to the button-component.
Create a button variant with 3 states: default, hover, active
Add the interactions: while hovering (default → hover), while pressing (hover → active)
Add an overlay (f.e. modal) that opens when you click the button
Test it out. When you click the button, the overlay opens, but the active state does not reset back to default. It persists, even after the overlay is closed. No way to get back to default state.
I currently fix this by adding a “mouse leave”-interaction that resets the button state. But it would be ideal, if the while pressing wouldn’t get stuck like that.
I have tried restarting Figma, but the While Pressed state stays on.
The “mouse leave” work around works for me, but it’s not the ideal experience. The while pressing should work the same whether the next target is a modal or not.
@Ville_Toivonen is on the right track (and I absolutely agree that this should be default behavior). I’d add a clarification, though:
The “mouse leave” interaction doesn’t seem to work with an overlay if that interaction is applied to the parent component or the default variant, but it does work (in my case) when applied to the active variant (changing active back to default). Note: This did require restarting the prototype, too (but that may have been because I was updating changes from a library). Hope this helps!