Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

prevent selected= from being included in the HTML twice, making it ha…

…rder to choose between priority countries in some browsers

Signed-off-by: Michael Koziarski <michael@koziarski.com>
  • Loading branch information...
commit f6b49db61dd1693f2e370eff3f32f3120ad94e3d 1 parent d3b5d86
@yyyc514 yyyc514 authored NZKoz committed
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/country_select.rb
View
4 lib/country_select.rb
@@ -17,6 +17,10 @@ def country_options_for_select(selected = nil, priority_countries = nil)
if priority_countries
country_options += options_for_select(priority_countries, selected)
country_options += "<option value=\"\" disabled=\"disabled\">-------------</option>\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)
Please sign in to comment.
Something went wrong with that request. Please try again.