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.
26 Likes

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.

9 Likes

I’m still looking for a solution to this :see_no_evil: - tried ‘mouse leave’, it doesn’t seem to work

3 Likes

Still no solution for this?

1 Like

I’m having a problem with this as well.

1 Like

I am also having the same issue.

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.

3 Likes

Same issue :frowning:

1 Like

Would be great if this gets adressed.

1 Like

@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!

5 Likes

Would be great if this gets adressed +1

3 Likes

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