Skip to main content
Question

Component variant swapping with hovering is buggy


Andrew_Q_Tran

Been stuck with this bug for awhile and I’m not sure what I’m doing wrong. Probably better explained in the GIF below:

Screen Recording 2023-07-11 at 5.05.45 PM

Basically I have created menu items (variants for icon only + active states) to put on a menu list (variants for expanded and collapsed). The arrow button would swap the menu list variants.

Here’s the Figma file if anyone’s interested in taking a look. Thank you so much in advance!

This topic has been closed for comments

9 replies

Andrew_Q_Tran

Here’s my setup


Eduardo_RH

I’ve been having the same issue. I followed tutorials like these:

But run into the same issue Andrew described: if there’s a hover state on the cell atom component, the segmented controller/toggle molecule component doesn’t work as expected, instead getting stuck in weird states with multiple cells being active.

It only works in the following states, neither desired:

  1. Remove hover states.
  2. Add a molecule component permutation for EVERY hover state.

I’m unable to upload the video, but here’s link to file: https://www.figma.com/file/2RhUlaOHI41oTbA6OCEwNC/Toggle-Test?type=design&node-id=0-1&mode=design&t=eohikBqvfg0yNiVr-11


tank666
  • 4863 replies
  • July 22, 2023

@Andrew_Q_Tran, your problem is that your collapsed and expanded variants for the menu button are different. The collapsed variant should have the text layer from the expanded variant, but hidden.


tank666
  • 4863 replies
  • July 22, 2023

@Eduardo_RH, your problem is different from the problem of the author of this topic. Your problem is that Figma preserve states. The solution is very simple—select all cell instances in the Toggle component variants, open the “on click” interaction details and check the “Reset component state” checkbox.


Andrew_Q_Tran

@tank666 I thought so too and have updated the linked Figma to include the hidden label. The problem still remains 😦

Screen Recording 2023-07-22 at 2.35.15 PM


Andrew_Q_Tran

However… I checked “Reset component state” per your recommendation to @Eduardo_RH above and it seems like it’s fixed!


Eduardo_RH

Holy shit that worked, thanks @tank666 !!

Is there documentation for that anywhere? would love to learn when I need it for the future.


tank666
  • 4863 replies
  • July 22, 2023

“Reset component state” should not have had an effect. What fixed your prototype was that you replaced the instances in the base component.

Previously, you used a component that was removed. That is, initially it’s used the wrong menu button component that exists in the file.
deleted-component


  • 0 replies
  • August 21, 2023

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings