Skip to content

Commit

Permalink
Fix: formatAYT when init plugin with number with ext
Browse files Browse the repository at this point in the history
  • Loading branch information
jackocnr committed Aug 7, 2024
1 parent ae38ebe commit e04b42c
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 2 deletions.
3 changes: 3 additions & 0 deletions build/js/intlTelInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -1997,6 +1997,9 @@ var factoryOutput = (() => {
_initTelInputListeners() {
const { strictMode, formatAsYouType, separateDialCode, formatOnDisplay } = this.options;
let userOverrideFormatting = false;
if (/\p{L}/u.test(this.telInput.value)) {
userOverrideFormatting = true;
}
const openDropdownWithPlus = () => {
this._openDropdown();
this.searchInput.value = "+";
Expand Down
2 changes: 1 addition & 1 deletion build/js/intlTelInput.min.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions build/js/intlTelInputWithUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1996,6 +1996,9 @@ var factoryOutput = (() => {
_initTelInputListeners() {
const { strictMode, formatAsYouType, separateDialCode, formatOnDisplay } = this.options;
let userOverrideFormatting = false;
if (/\p{L}/u.test(this.telInput.value)) {
userOverrideFormatting = true;
}
const openDropdownWithPlus = () => {
this._openDropdown();
this.searchInput.value = "+";
Expand Down
2 changes: 1 addition & 1 deletion build/js/intlTelInputWithUtils.min.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions react/build/IntlTelInput.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -1992,6 +1992,9 @@ var Iti = class {
_initTelInputListeners() {
const { strictMode, formatAsYouType, separateDialCode, formatOnDisplay } = this.options;
let userOverrideFormatting = false;
if (/\p{L}/u.test(this.telInput.value)) {
userOverrideFormatting = true;
}
const openDropdownWithPlus = () => {
this._openDropdown();
this.searchInput.value = "+";
Expand Down
3 changes: 3 additions & 0 deletions react/build/IntlTelInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -1956,6 +1956,9 @@ var Iti = class {
_initTelInputListeners() {
const { strictMode, formatAsYouType, separateDialCode, formatOnDisplay } = this.options;
let userOverrideFormatting = false;
if (/\p{L}/u.test(this.telInput.value)) {
userOverrideFormatting = true;
}
const openDropdownWithPlus = () => {
this._openDropdown();
this.searchInput.value = "+";
Expand Down
3 changes: 3 additions & 0 deletions react/build/IntlTelInputWithUtils.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -1992,6 +1992,9 @@ var Iti = class {
_initTelInputListeners() {
const { strictMode, formatAsYouType, separateDialCode, formatOnDisplay } = this.options;
let userOverrideFormatting = false;
if (/\p{L}/u.test(this.telInput.value)) {
userOverrideFormatting = true;
}
const openDropdownWithPlus = () => {
this._openDropdown();
this.searchInput.value = "+";
Expand Down
3 changes: 3 additions & 0 deletions react/build/IntlTelInputWithUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1956,6 +1956,9 @@ var Iti = class {
_initTelInputListeners() {
const { strictMode, formatAsYouType, separateDialCode, formatOnDisplay } = this.options;
let userOverrideFormatting = false;
if (/\p{L}/u.test(this.telInput.value)) {
userOverrideFormatting = true;
}
const openDropdownWithPlus = () => {
this._openDropdown();
this.searchInput.value = "+";
Expand Down
3 changes: 3 additions & 0 deletions react/demo/set-number-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -25485,6 +25485,9 @@
_initTelInputListeners() {
const { strictMode, formatAsYouType, separateDialCode, formatOnDisplay } = this.options;
let userOverrideFormatting = false;
if (/\p{L}/u.test(this.telInput.value)) {
userOverrideFormatting = true;
}
const openDropdownWithPlus = () => {
this._openDropdown();
this.searchInput.value = "+";
Expand Down
3 changes: 3 additions & 0 deletions react/demo/simple-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -25485,6 +25485,9 @@
_initTelInputListeners() {
const { strictMode, formatAsYouType, separateDialCode, formatOnDisplay } = this.options;
let userOverrideFormatting = false;
if (/\p{L}/u.test(this.telInput.value)) {
userOverrideFormatting = true;
}
const openDropdownWithPlus = () => {
this._openDropdown();
this.searchInput.value = "+";
Expand Down
3 changes: 3 additions & 0 deletions react/demo/toggle-disabled-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -25485,6 +25485,9 @@
_initTelInputListeners() {
const { strictMode, formatAsYouType, separateDialCode, formatOnDisplay } = this.options;
let userOverrideFormatting = false;
if (/\p{L}/u.test(this.telInput.value)) {
userOverrideFormatting = true;
}
const openDropdownWithPlus = () => {
this._openDropdown();
this.searchInput.value = "+";
Expand Down
3 changes: 3 additions & 0 deletions react/demo/validation-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -25485,6 +25485,9 @@
_initTelInputListeners() {
const { strictMode, formatAsYouType, separateDialCode, formatOnDisplay } = this.options;
let userOverrideFormatting = false;
if (/\p{L}/u.test(this.telInput.value)) {
userOverrideFormatting = true;
}
const openDropdownWithPlus = () => {
this._openDropdown();
this.searchInput.value = "+";
Expand Down
4 changes: 4 additions & 0 deletions src/js/intl-tel-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1203,6 +1203,10 @@ export class Iti {
private _initTelInputListeners(): void {
const { strictMode, formatAsYouType, separateDialCode, formatOnDisplay } = this.options;
let userOverrideFormatting = false;
//* If the initial val contains any alpha chars (e.g. the extension separator "ext."), then set the override, as libphonenumber's AYT-formatter cannot handle alphas.
if (/\p{L}/u.test(this.telInput.value)) {
userOverrideFormatting = true;
}

const openDropdownWithPlus = () => {
this._openDropdown();
Expand Down

0 comments on commit e04b42c

Please sign in to comment.