Hi!
It took me a few hours to understand how this component work, especially when it is about setting a default value or selecting an option dynamically or resetting the component. So for those who will struggle like me, here is an example code that works and could be useful on the documentation page
You may wonder why I do that (publish working examples on that forum) instead of doing my job (developing apps): just because I spent 4 hours doing something that should have been done in 10 minutes. So 5 minutes more to help people, that’s really cheap. I can’t stand to imagine that every Forge developers are in the same situation, much too often.
Hi @BertrandDrouhard1
Thanks so much for your sharing. The solution seems not so easy.
To Atlassian, could we make developers more easily to get things done? @AtlassianSupport
Thanks,
YY
Hi @BertrandDrouhard1 ,
Thanks for sharing your findings with the community! To expand on your answer, onChange does not need the additional logic for what you’re trying to do. Here’s an example that replicates the same behaviour you have but removes the logic in onChange. You can reuse the selectOption state for rendering the text above instead. Hope it makes sense!