Skip to content

Commit

Permalink
Fix utilsScript relative path bug
Browse files Browse the repository at this point in the history
  • Loading branch information
victorybiz committed Sep 27, 2021
1 parent 4f4e7ef commit b581029
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to `laravel-tel-input` will be documented in this file

## v1.1.4 - 2021-09-27

- Fix utilsScript relative path bug

## v1.1.3 - 2021-09-09

- Fix input rendering issues on Livewire modals and popups.
Expand Down
2 changes: 1 addition & 1 deletion config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@
* utilsScript
* - path to the utils.js file in public/ directory.
*/
'utilsScript' => 'vendor/intl-tel-input/build/js/utils.js',
'utilsScript' => '/vendor/intl-tel-input/build/js/utils.js',
]
];
2 changes: 1 addition & 1 deletion public/js/laravel-tel-input.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions resources/js/laravel-tel-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@
delete options.customPlaceholder; // unset if undefined function
}

// utilsScript option
if (options.utilsScript) {
// Fix utilsScript relative path bug
options.utilsScript = options.utilsScript.charAt(0) == '/' ? options.utilsScript : '/' + options.utilsScript;
}

// init the tel input
const itiPhone = window.intlTelInput(telInput, options);

Expand Down

0 comments on commit b581029

Please sign in to comment.