2021年1月18日星期一

Default value in select when the item isnt in the dropdown

This is a very common error that I have come across and I havent really found a solution for it. I made a codesandbox version of it. Instead of arrays I get the data from an api but its the same principle. Here is the link

When the default value isnt loaded into the dropdown the default value is just 7. Which I dont want. I need the entire option item to load by default. Ive tried alot and Im not sure how this can be done but I havent found anything online on this topic. By changing the default value to something that is in the initial dropdown then it loads the initial option item.

https://stackoverflow.com/questions/65783176/default-value-in-select-when-the-item-isnt-in-the-dropdown January 19, 2021 at 06:54AM

没有评论:

发表评论