Skip to content

Commit

Permalink
Fix: separateDialCode, select AX, type 4, changes to Finland
Browse files Browse the repository at this point in the history
  • Loading branch information
jackocnr committed Dec 8, 2024
1 parent e620c78 commit e3bb810
Show file tree
Hide file tree
Showing 15 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion build/js/intlTelInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -2603,7 +2603,7 @@ var factoryOutput = (() => {
if (!selectedIso2 && this.defaultCountry && iso2Codes.includes(this.defaultCountry)) {
return this.defaultCountry;
}
const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && numeric.length === dialCodeMatchNumeric.length;
const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && (numeric.length === dialCodeMatchNumeric.length || !this.selectedCountryData.areaCodes);
const isRegionlessNanpNumber = selectedDialCode === "1" && isRegionlessNanp(numeric);
if (!isRegionlessNanpNumber && !alreadySelected) {
for (let j = 0; j < iso2Codes.length; j++) {
Expand Down
2 changes: 1 addition & 1 deletion build/js/intlTelInput.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/js/intlTelInputWithUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2602,7 +2602,7 @@ var factoryOutput = (() => {
if (!selectedIso2 && this.defaultCountry && iso2Codes.includes(this.defaultCountry)) {
return this.defaultCountry;
}
const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && numeric.length === dialCodeMatchNumeric.length;
const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && (numeric.length === dialCodeMatchNumeric.length || !this.selectedCountryData.areaCodes);
const isRegionlessNanpNumber = selectedDialCode === "1" && isRegionlessNanp(numeric);
if (!isRegionlessNanpNumber && !alreadySelected) {
for (let j = 0; j < iso2Codes.length; j++) {
Expand Down
2 changes: 1 addition & 1 deletion build/js/intlTelInputWithUtils.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion react/build/IntlTelInput.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2598,7 +2598,7 @@ var Iti = class {
if (!selectedIso2 && this.defaultCountry && iso2Codes.includes(this.defaultCountry)) {
return this.defaultCountry;
}
const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && numeric.length === dialCodeMatchNumeric.length;
const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && (numeric.length === dialCodeMatchNumeric.length || !this.selectedCountryData.areaCodes);
const isRegionlessNanpNumber = selectedDialCode === "1" && isRegionlessNanp(numeric);
if (!isRegionlessNanpNumber && !alreadySelected) {
for (let j = 0; j < iso2Codes.length; j++) {
Expand Down
2 changes: 1 addition & 1 deletion react/build/IntlTelInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -2562,7 +2562,7 @@ var Iti = class {
if (!selectedIso2 && this.defaultCountry && iso2Codes.includes(this.defaultCountry)) {
return this.defaultCountry;
}
const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && numeric.length === dialCodeMatchNumeric.length;
const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && (numeric.length === dialCodeMatchNumeric.length || !this.selectedCountryData.areaCodes);
const isRegionlessNanpNumber = selectedDialCode === "1" && isRegionlessNanp(numeric);
if (!isRegionlessNanpNumber && !alreadySelected) {
for (let j = 0; j < iso2Codes.length; j++) {
Expand Down
2 changes: 1 addition & 1 deletion react/build/IntlTelInputWithUtils.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2598,7 +2598,7 @@ var Iti = class {
if (!selectedIso2 && this.defaultCountry && iso2Codes.includes(this.defaultCountry)) {
return this.defaultCountry;
}
const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && numeric.length === dialCodeMatchNumeric.length;
const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && (numeric.length === dialCodeMatchNumeric.length || !this.selectedCountryData.areaCodes);
const isRegionlessNanpNumber = selectedDialCode === "1" && isRegionlessNanp(numeric);
if (!isRegionlessNanpNumber && !alreadySelected) {
for (let j = 0; j < iso2Codes.length; j++) {
Expand Down
2 changes: 1 addition & 1 deletion react/build/IntlTelInputWithUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2562,7 +2562,7 @@ var Iti = class {
if (!selectedIso2 && this.defaultCountry && iso2Codes.includes(this.defaultCountry)) {
return this.defaultCountry;
}
const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && numeric.length === dialCodeMatchNumeric.length;
const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && (numeric.length === dialCodeMatchNumeric.length || !this.selectedCountryData.areaCodes);
const isRegionlessNanpNumber = selectedDialCode === "1" && isRegionlessNanp(numeric);
if (!isRegionlessNanpNumber && !alreadySelected) {
for (let j = 0; j < iso2Codes.length; j++) {
Expand Down
2 changes: 1 addition & 1 deletion react/demo/set-number/set-number-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -26149,7 +26149,7 @@
if (!selectedIso2 && this.defaultCountry && iso2Codes.includes(this.defaultCountry)) {
return this.defaultCountry;
}
const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && numeric.length === dialCodeMatchNumeric.length;
const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && (numeric.length === dialCodeMatchNumeric.length || !this.selectedCountryData.areaCodes);
const isRegionlessNanpNumber = selectedDialCode === "1" && isRegionlessNanp(numeric);
if (!isRegionlessNanpNumber && !alreadySelected) {
for (let j = 0; j < iso2Codes.length; j++) {
Expand Down
2 changes: 1 addition & 1 deletion react/demo/simple/simple-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -26149,7 +26149,7 @@
if (!selectedIso2 && this.defaultCountry && iso2Codes.includes(this.defaultCountry)) {
return this.defaultCountry;
}
const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && numeric.length === dialCodeMatchNumeric.length;
const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && (numeric.length === dialCodeMatchNumeric.length || !this.selectedCountryData.areaCodes);
const isRegionlessNanpNumber = selectedDialCode === "1" && isRegionlessNanp(numeric);
if (!isRegionlessNanpNumber && !alreadySelected) {
for (let j = 0; j < iso2Codes.length; j++) {
Expand Down
2 changes: 1 addition & 1 deletion react/demo/toggle-disabled/toggle-disabled-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -26149,7 +26149,7 @@
if (!selectedIso2 && this.defaultCountry && iso2Codes.includes(this.defaultCountry)) {
return this.defaultCountry;
}
const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && numeric.length === dialCodeMatchNumeric.length;
const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && (numeric.length === dialCodeMatchNumeric.length || !this.selectedCountryData.areaCodes);
const isRegionlessNanpNumber = selectedDialCode === "1" && isRegionlessNanp(numeric);
if (!isRegionlessNanpNumber && !alreadySelected) {
for (let j = 0; j < iso2Codes.length; j++) {
Expand Down
2 changes: 1 addition & 1 deletion react/demo/validation/validation-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -26149,7 +26149,7 @@
if (!selectedIso2 && this.defaultCountry && iso2Codes.includes(this.defaultCountry)) {
return this.defaultCountry;
}
const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && numeric.length === dialCodeMatchNumeric.length;
const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && (numeric.length === dialCodeMatchNumeric.length || !this.selectedCountryData.areaCodes);
const isRegionlessNanpNumber = selectedDialCode === "1" && isRegionlessNanp(numeric);
if (!isRegionlessNanpNumber && !alreadySelected) {
for (let j = 0; j < iso2Codes.length; j++) {
Expand Down
4 changes: 2 additions & 2 deletions src/js/intl-tel-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1453,8 +1453,8 @@ export class Iti {

//* Check if the right country is already selected (note: might be empty state - globe icon).
//* NOTE: the number of digits typed can only be the same as or more than the matched dial code (plus area code) digits
//* If they're the same length, that's a perfect match. Otherwise, they've typed more digits than the best match, in which case we should default to the first country that fits the matched dial code.
const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && numeric.length === dialCodeMatchNumeric.length;
//* If they're the same length, that's a perfect match. Otherwise, they've typed more digits than the best match, in which case, if this country supports area codes, we should default to the first country that fits the matched dial code.
const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && (numeric.length === dialCodeMatchNumeric.length || !this.selectedCountryData.areaCodes);

const isRegionlessNanpNumber =
selectedDialCode === "1" && isRegionlessNanp(numeric);
Expand Down
2 changes: 1 addition & 1 deletion vue/build/IntlTelInput.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2166,7 +2166,7 @@ class G {
const a = v(o), c = this.dialCodeToIso2Map[a];
if (!s && this.defaultCountry && c.includes(this.defaultCountry))
return this.defaultCountry;
const d = s && c.includes(s) && r.length === a.length;
const d = s && c.includes(s) && (r.length === a.length || !this.selectedCountryData.areaCodes);
if (!(n === "1" && S(r)) && !d) {
for (let p = 0; p < c.length; p++)
if (c[p])
Expand Down
2 changes: 1 addition & 1 deletion vue/build/IntlTelInputWithUtils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2166,7 +2166,7 @@ class K2 {
const f = c1(c), S = this.dialCodeToIso2Map[f];
if (!o && this.defaultCountry && S.includes(this.defaultCountry))
return this.defaultCountry;
const _ = o && S.includes(o) && g.length === f.length;
const _ = o && S.includes(o) && (g.length === f.length || !this.selectedCountryData.areaCodes);
if (!(a === "1" && o2(g)) && !_) {
for (let w = 0; w < S.length; w++)
if (S[w])
Expand Down

0 comments on commit e3bb810

Please sign in to comment.