Skip to main content
Question

Onclick interaction being overridden by a variant. how to prevent this?

  • April 17, 2024
  • 1 reply
  • 104 views

Nikki_B

I have a component with variants that has an onclick interaction:
image

however, when i created an instance for this component, i need to add interaction-onclick also to switch the contents on my page based on the services links. this overrides my first onclick interaction.

is there any way on how to resolve or prevent this one so that whatever the user clicks on the link, the link will be emphasized (property-onclick of variant) at the same time will display the corresponding content on the page.

TIA!

This topic has been closed for comments

1 reply

Vishal_Ramawat

Figma doesn’t let you do that.
I faced similar issue while creating a prototype to Enable/Disable button on Selecting a Checkbox (having variants Checked/Unchecked onClick).
You’ll need a workaround for that.
Creating variables assigned to the Menu item property.
So for each Menu item, you’ll have to create respective Variable to change their state to Selected, while changing the other menu item states to Unselected.
Menu 1 > Onclick

Set Variable - varMenu1 == Selected
Set Variable - varMenu2 == UnSelected
Set Variable - varMenu3 == UnSelected
Set Variable - varContent == Menu1Content


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