Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,12 @@ class PhoneInput extends React.Component {
let countryGuess;
if (props.disableInitialCountryGuess) {
countryGuess = 0;
} else if (inputNumber.length > 1) {
// Country detect by phone
countryGuess = this.guessSelectedCountry(inputNumber.substring(0, 6), props.country, onlyCountries, hiddenAreaCodes) || 0;
} else if (props.country) {
// Default country
countryGuess = onlyCountries.find(o => o.iso2 == props.country) || 0;
} else if (inputNumber.length > 1) {
// Country detect by phone
countryGuess = this.guessSelectedCountry(inputNumber.substring(0, 6), props.country, onlyCountries, hiddenAreaCodes) || 0;
} else {
// Empty params
countryGuess = 0;
Expand Down