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

Dynamic updates don't populate region when country option is also included #63

Open
jwoertink opened this issue Oct 7, 2021 · 1 comment

Comments

@jwoertink
Copy link

I have a setup sort of like this:

<script>
export default {
  props: {
    location: {
      type: Object, required: true
    }
  }
}
</script>

<template>
  <country-select v-model="location.country" :country="location.country" topCountry="US" />
  <region-select v-model="location.region" :country="location.country" :region="location.region" />
</template>

Then I have a button on the page that will load a different object passing in a different location. When this happens, the country is populated correctly, but the region is always blank, unless I remove the country option from region-select. Though, that leads to other issues if the region isn't a U.S. state....

My guess is maybe it's trying to populate both country and region at the same time, but there's some sort of race condition where region has to wait until after country has loaded..

@davidtmnolan
Copy link

davidtmnolan commented Mar 7, 2022

Same issue. When using google address autocomplete to fill in form fields, the region is blank, even if country is set before region.

As a workaround, I added a 2 second delay after setting the country before setting the region.

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

2 participants