Open patrick-levesque opened 5 years ago
Quick workaround is to set data-default-value
to the desired country, "hide" the country select (display: none;
) and show its value in a dummy input field or <p>
tag. But this still requires at least 2 countries in the custom build to work.
Would be nice to only update library custom build with new countries without touching each forms in the code...
Hey @paralel-github, thanks for the heads up. Bug! I'll patch this in the next release - you shouldn't have to do a workaround for this.
Hello @benkeen
I create a pull request to fix this issue, can you please check?
Thank you for the awesome projects.
Hi! I'm trying to use this library with only 1 country (US to start with but will add other later) and when I try to set
data-default-value
for region with previous form value or default to 'California', region dropdown always shows 1st value 'Alabama'. Works well if I have 2 countries or more (ex. US and Canada).Tried a custom build with
grunt customBuild --countries="United States"
or using thedata-whitelist="US"
with all countries.Here's the code:
<select id="country" name="country" class="form-control input-fields crs-country" data-whitelist="US" data-region-id="province" data-default-value="United States" data-show-default-option="false"></select>
<select id="province" name="province" class="form-control input-fields" data-default-value="California" data-show-default-option="false"></select>
Thanks!