Skip to content

Bug in select element in combination with state handling #756

Answered by ahohnsen
TobiasSteinhagen asked this question in Web
Discussion options

You must be logged in to vote

Hi there,

As we already discussed, you are missing the value attribute on your country select in your EditForm:

<option selected value={defaultIsoCode}>
              {country} {defaultFlag}
            </option>
            {countries.map(({ isoCode, flag, name }) => (
              <option key={isoCode} value={isoCode}>
                {name} {flag}
              </option>
            ))}

You need the countries iso code to determine the cities of the respective country. 🙂

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ahohnsen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Web
Labels
None yet
2 participants