Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I toggle dropdown via other element? #230

Open
Maciej916 opened this issue Oct 20, 2021 · 1 comment
Open

Can I toggle dropdown via other element? #230

Maciej916 opened this issue Oct 20, 2021 · 1 comment

Comments

@Maciej916
Copy link

I would like to toggle dropdown by clicking for example button not dropdown by itself, is it possible?

@a3803896
Copy link

a3803896 commented Nov 10, 2021

All have to do is to change the state bind to the Dropdown component.

const [optionValue, setOptionValue] = useState('');
<Dropdown
      options={options}
      value={optionValue}
      onChange={(e) => setOptionValue(e.value)}
      placeholder={''}
/>
//call this
setOptionValue('STRING_VALUE');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants