Skip to content

Commit

Permalink
Fix broken test - typing valid dial code from globe icon doesnt updat…
Browse files Browse the repository at this point in the history
…e flag
  • Loading branch information
jackocnr committed Dec 7, 2024
1 parent bb53a52 commit 3134e3c
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 @@ -2599,7 +2599,7 @@ var factoryOutput = (() => {
if (dialCode) {
const dialCodeNumerics = getNumeric(dialCode);
const iso2Codes = this.dialCodeToIso2Map[dialCodeNumerics];
const alreadySelected = iso2Codes.includes(this.selectedCountryData.iso2);
const alreadySelected = this.selectedCountryData.iso2 && iso2Codes.includes(this.selectedCountryData.iso2);
let areaCodeMatch = false;
if (alreadySelected) {
if (this.selectedCountryData.areaCodes && numeric.length > selectedDialCode.length) {
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 @@ -2598,7 +2598,7 @@ var factoryOutput = (() => {
if (dialCode) {
const dialCodeNumerics = getNumeric(dialCode);
const iso2Codes = this.dialCodeToIso2Map[dialCodeNumerics];
const alreadySelected = iso2Codes.includes(this.selectedCountryData.iso2);
const alreadySelected = this.selectedCountryData.iso2 && iso2Codes.includes(this.selectedCountryData.iso2);
let areaCodeMatch = false;
if (alreadySelected) {
if (this.selectedCountryData.areaCodes && numeric.length > selectedDialCode.length) {
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 @@ -2594,7 +2594,7 @@ var Iti = class {
if (dialCode) {
const dialCodeNumerics = getNumeric(dialCode);
const iso2Codes = this.dialCodeToIso2Map[dialCodeNumerics];
const alreadySelected = iso2Codes.includes(this.selectedCountryData.iso2);
const alreadySelected = this.selectedCountryData.iso2 && iso2Codes.includes(this.selectedCountryData.iso2);
let areaCodeMatch = false;
if (alreadySelected) {
if (this.selectedCountryData.areaCodes && numeric.length > selectedDialCode.length) {
Expand Down
2 changes: 1 addition & 1 deletion react/build/IntlTelInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -2558,7 +2558,7 @@ var Iti = class {
if (dialCode) {
const dialCodeNumerics = getNumeric(dialCode);
const iso2Codes = this.dialCodeToIso2Map[dialCodeNumerics];
const alreadySelected = iso2Codes.includes(this.selectedCountryData.iso2);
const alreadySelected = this.selectedCountryData.iso2 && iso2Codes.includes(this.selectedCountryData.iso2);
let areaCodeMatch = false;
if (alreadySelected) {
if (this.selectedCountryData.areaCodes && numeric.length > selectedDialCode.length) {
Expand Down
2 changes: 1 addition & 1 deletion react/build/IntlTelInputWithUtils.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2594,7 +2594,7 @@ var Iti = class {
if (dialCode) {
const dialCodeNumerics = getNumeric(dialCode);
const iso2Codes = this.dialCodeToIso2Map[dialCodeNumerics];
const alreadySelected = iso2Codes.includes(this.selectedCountryData.iso2);
const alreadySelected = this.selectedCountryData.iso2 && iso2Codes.includes(this.selectedCountryData.iso2);
let areaCodeMatch = false;
if (alreadySelected) {
if (this.selectedCountryData.areaCodes && numeric.length > selectedDialCode.length) {
Expand Down
2 changes: 1 addition & 1 deletion react/build/IntlTelInputWithUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2558,7 +2558,7 @@ var Iti = class {
if (dialCode) {
const dialCodeNumerics = getNumeric(dialCode);
const iso2Codes = this.dialCodeToIso2Map[dialCodeNumerics];
const alreadySelected = iso2Codes.includes(this.selectedCountryData.iso2);
const alreadySelected = this.selectedCountryData.iso2 && iso2Codes.includes(this.selectedCountryData.iso2);
let areaCodeMatch = false;
if (alreadySelected) {
if (this.selectedCountryData.areaCodes && numeric.length > selectedDialCode.length) {
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 @@ -26145,7 +26145,7 @@
if (dialCode) {
const dialCodeNumerics = getNumeric(dialCode);
const iso2Codes = this.dialCodeToIso2Map[dialCodeNumerics];
const alreadySelected = iso2Codes.includes(this.selectedCountryData.iso2);
const alreadySelected = this.selectedCountryData.iso2 && iso2Codes.includes(this.selectedCountryData.iso2);
let areaCodeMatch = false;
if (alreadySelected) {
if (this.selectedCountryData.areaCodes && numeric.length > selectedDialCode.length) {
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 @@ -26145,7 +26145,7 @@
if (dialCode) {
const dialCodeNumerics = getNumeric(dialCode);
const iso2Codes = this.dialCodeToIso2Map[dialCodeNumerics];
const alreadySelected = iso2Codes.includes(this.selectedCountryData.iso2);
const alreadySelected = this.selectedCountryData.iso2 && iso2Codes.includes(this.selectedCountryData.iso2);
let areaCodeMatch = false;
if (alreadySelected) {
if (this.selectedCountryData.areaCodes && numeric.length > selectedDialCode.length) {
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 @@ -26145,7 +26145,7 @@
if (dialCode) {
const dialCodeNumerics = getNumeric(dialCode);
const iso2Codes = this.dialCodeToIso2Map[dialCodeNumerics];
const alreadySelected = iso2Codes.includes(this.selectedCountryData.iso2);
const alreadySelected = this.selectedCountryData.iso2 && iso2Codes.includes(this.selectedCountryData.iso2);
let areaCodeMatch = false;
if (alreadySelected) {
if (this.selectedCountryData.areaCodes && numeric.length > selectedDialCode.length) {
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 @@ -26145,7 +26145,7 @@
if (dialCode) {
const dialCodeNumerics = getNumeric(dialCode);
const iso2Codes = this.dialCodeToIso2Map[dialCodeNumerics];
const alreadySelected = iso2Codes.includes(this.selectedCountryData.iso2);
const alreadySelected = this.selectedCountryData.iso2 && iso2Codes.includes(this.selectedCountryData.iso2);
let areaCodeMatch = false;
if (alreadySelected) {
if (this.selectedCountryData.areaCodes && numeric.length > selectedDialCode.length) {
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 @@ -1477,8 +1477,8 @@ export class Iti {
if (dialCode) {
const dialCodeNumerics = getNumeric(dialCode);
const iso2Codes = this.dialCodeToIso2Map[dialCodeNumerics];
//* Check if the right country is already selected
const alreadySelected = iso2Codes.includes(this.selectedCountryData.iso2);
//* Check if the right country is already selected (note: might be empty state - globe icon).
const alreadySelected = this.selectedCountryData.iso2 && iso2Codes.includes(this.selectedCountryData.iso2);
let areaCodeMatch = false;
if (alreadySelected) {
//* If this country has area codes, and the user has typed something after the dial code, then see if it matches.
Expand Down
2 changes: 1 addition & 1 deletion vue/build/IntlTelInput.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2143,7 +2143,7 @@ class G {
i && s === "1" && i.charAt(0) !== "+" && (i.charAt(0) !== "1" && (i = `1${i}`), i = `+${i}`), this.options.separateDialCode && s && i.charAt(0) !== "+" && (i = `+${s}${i}`);
const o = this._getDialCode(i, !0), a = v(i);
if (o) {
const r = v(o), p = this.dialCodeToIso2Map[r], h = p.includes(this.selectedCountryData.iso2);
const r = v(o), p = this.dialCodeToIso2Map[r], h = this.selectedCountryData.iso2 && p.includes(this.selectedCountryData.iso2);
let c = !1;
if (h && (this.selectedCountryData.areaCodes && a.length > s.length ? c = this._isAreaCodeMatch(a, r) : c = !0), !(s === "1" && S(a)) && (!h || !c)) {
for (let d = 0; d < p.length; d++)
Expand Down
2 changes: 1 addition & 1 deletion vue/build/IntlTelInputWithUtils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2143,7 +2143,7 @@ class K2 {
i && o === "1" && i.charAt(0) !== "+" && (i.charAt(0) !== "1" && (i = `1${i}`), i = `+${i}`), this.options.separateDialCode && o && i.charAt(0) !== "+" && (i = `+${o}${i}`);
const c = this._getDialCode(i, !0), f = c1(i);
if (c) {
const p = c1(c), w = this.dialCodeToIso2Map[p], I = w.includes(this.selectedCountryData.iso2);
const p = c1(c), w = this.dialCodeToIso2Map[p], I = this.selectedCountryData.iso2 && w.includes(this.selectedCountryData.iso2);
let S = !1;
if (I && (this.selectedCountryData.areaCodes && f.length > o.length ? S = this._isAreaCodeMatch(f, p) : S = !0), !(o === "1" && o2(f)) && (!I || !S)) {
for (let _ = 0; _ < w.length; _++)
Expand Down

0 comments on commit 3134e3c

Please sign in to comment.