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

city do not change when selected in the dropdown i guess the error is related to values of option the value is same for all options #743

Open
sumiran01 opened this issue Jan 21, 2024 · 4 comments

Comments

@sumiran01
Copy link

No description provided.

@dr5hn
Copy link
Owner

dr5hn commented Jan 21, 2024

@sumiran01 Issue seems to be on your code end. Is it possible for you to share code here? Make sure to mask API Key when sending code.

@sumiran01
Copy link
Author

const[city, setcity]=useState(shippingInfo.city);

<select required name="city" value={city} onChange={(e)=>setcity(e.target.value)}>

 <option>City</option>
 {
  City && City.getCitiesOfState  (country,state).map((item)=>(
    <option key={item.stateCode} value={item.stateCode}>{item.name}</option>
  ))
 }
</select>

@dr5hn
Copy link
Owner

dr5hn commented Jan 22, 2024

Can you please share a full code on how you're getting statecode and country code? also content of getCitiesOfState?

@Ranjeet0605
Copy link

this is use to if any essue related to city {City && City.getCitiesOfState(country,state).map((item)=>(

<option key={item.stateCode} value={item.stateCode}>{item.name}</option>

))}

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

3 participants