File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -486,7 +486,7 @@ class PhoneInput extends React.Component {
486486 e . preventDefault ( ) ;
487487 if ( ! this . state . showDropdown && this . props . disabled ) return ;
488488 const { preferredCountries, selectedCountry } = this . state
489- const allCountries = preferredCountries . concat ( this . state . onlyCountries )
489+ const allCountries = [ ... new Set ( preferredCountries . concat ( this . state . onlyCountries ) ) ] ;
490490
491491 const highlightCountryIndex = allCountries . findIndex ( o =>
492492 o . dialCode === selectedCountry . dialCode && o . iso2 === selectedCountry . iso2 ) ;
@@ -764,7 +764,7 @@ class PhoneInput extends React.Component {
764764 getSearchFilteredCountries = ( ) => {
765765 const { preferredCountries, onlyCountries, searchValue } = this . state
766766 const { enableSearch } = this . props
767- const allCountries = preferredCountries . concat ( onlyCountries ) ;
767+ const allCountries = [ ... new Set ( preferredCountries . concat ( onlyCountries ) ) ] ;
768768 const sanitizedSearchValue = searchValue . trim ( ) . toLowerCase ( ) ;
769769 if ( enableSearch && sanitizedSearchValue ) {
770770 // [...new Set()] to get rid of duplicates
You can’t perform that action at this time.
0 commit comments