How to clear selected items in Atlaskit Select when another select content changes?

I’m developing a jira cloud plugin and I’m using Atlaskit Form and Select component. Now I want to clear selected items in Select box when another select content changes, what should i do?

Please see the picture in the attach.

I’m not able to show you any example code yet because I’m browsing with my phone.

Atlaskit form has a prop called ‘setValue’ where you can see the value for any other field in the form. So you can catch the ‘onChange’ of the current field and set value for the other.

You can take a look at this example: Atlaskit by Atlassian

Thanks a lot. I can see that Atlaskit Form has a prop called ‘setFieldValue’, and it also has a prop called getValues, is that mean I can get the selected items without subbmitting the form? because I think I also need to use this function next.

1 Like

The example code you provided is very useful, but it is not in the Atlaskit Form Example Code. It also include the onChange(), it’s very useful for the beginners to understand the Form component.

Yes, the prop getValues allows you to get the value of all fields in the Form.
But if you have a complex scenario, I encourage you to take control on your own. You can post the code here, and I might be able to provide further help.

I’m not sure if I understand you wrong, but that Example is for Atlaskit form.

Based on the help you’ve provided, I can handle the coding at the moment. I will ask for your help if I cannot solve the problem. Thanks for your patience. :joy: