diff --git a/lib/country-select.rb b/lib/country-select.rb index d28db95..74c04a5 100644 --- a/lib/country-select.rb +++ b/lib/country-select.rb @@ -20,6 +20,10 @@ def country_options_for_select(selected = nil, priority_countries = nil) end country_options += options_for_select(priority_countries, selected) country_options += "\n" + # prevents selected from being included twice in the HTML which causes + # some browsers to select the second selected option (not priority) + # which makes it harder to select an alternative priority country + selected=nil if priority_countries.include?(selected) end return country_options + options_for_select(COUNTRIES, selected)