Figma Support Forum

While pressing -state doesn't reset after overlay is closed

Typical case, can be replicated with the Playground file too, if you just add a “while pressing”-variant to the button-component.

  1. Create a button variant with 3 states: default, hover, active
  2. Add the interactions: while hovering (default → hover), while pressing (hover → active)
  3. Add an overlay (f.e. modal) that opens when you click the button
  4. 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.