Skip to main content
Solved

Enable button when dropdown item selected

  • November 17, 2023
  • 2 replies
  • 646 views

Mara_Varady

Hello,

I currently am working on an app account creation screen where I want to only enable a button when an item in a dropdown menu is selected. I have tried every which way I can think of, but the best I can do is enabling the button when the dropdown is first opened.

Hoping someone here can help. TIA!

Figma file: https://www.figma.com/file/8J5I19w9pMMfdmeF77kDq2/Untitled?type=design&node-id=975%3A6339&mode=design&t=lpau2Z6NMjnWLWuL-1

Best answer by Michael_Persson

One way to accomplish this is by using a primitive state machine that loops through variants and checks for a variable state, which is set by the dropdown.

I made a demo here, where the first item in the “dropdown” sets the variable buttonActive to true or false, which shifts the internal loop in the button component to the correct state.

Figma – 11 Nov 22
View original

2 replies

Michael_Persson

One way to accomplish this is by using a primitive state machine that loops through variants and checks for a variable state, which is set by the dropdown.

I made a demo here, where the first item in the “dropdown” sets the variable buttonActive to true or false, which shifts the internal loop in the button component to the correct state.

Figma – 11 Nov 22

Mara_Varady

@Michael_Persson Thanks so much! I was actually somehow able to get it to work by using a “while pressing” action as opposed to a “on click” action.


Reply


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