yii2-phone-input icon indicating copy to clipboard operation
yii2-phone-input copied to clipboard

$(...).intlTelInput is not a function

Open i-panov opened this issue 6 years ago • 11 comments

  1. JQuery included in header (by default in yii)

header

  1. intlTelInput.min.js included after footer and after it the handler is registered.

console

An error occurs on the handler registration line: $('#account-phone').intlTelInput();

error

I can not understand why this is happening? Help me please!

i-panov avatar Oct 29 '18 14:10 i-panov

I understood what was the matter! It looks like a bug! PhoneInputAsset is not included intlTelInput-jquery.min.js. Including it manually corrected the situation (the widget was displayed), but this is not a solution. Please add it because it is obviously a bug!!!

i-panov avatar Oct 29 '18 14:10 i-panov

@Borales Will you react to this? Or should I start looking for another solution? I already wrote you a pull request, but you ignore me.

i-panov avatar Nov 08 '18 09:11 i-panov

@i-panov Hi, sorry for the delay. Thank you for your PR, I posted a comment for it.

Borales avatar Nov 08 '18 09:11 Borales

Having the same issue with the last version.

i-panov path fix it!!

The fix:

src/PhoneInputAsset.php

public $js = [
    'build/js/utils.js',
    'build/js/intlTelInput.min.js',
    'build/js/intlTelInput-jquery.min.js',  <------------ ADD THIS

Buliwyfa avatar Sep 29 '19 02:09 Buliwyfa

they have removed jquery dependency on main file, you have to include jquery version in PhoneInputAsset

alireza-salehi avatar Oct 04 '19 07:10 alireza-salehi

Issue appeared a year ago. And it still there!

andrey-denisenko avatar Oct 09 '19 00:10 andrey-denisenko

@andrey-denisenko @alireza-salehi please check 0.3.0 release

Borales avatar Oct 17 '19 08:10 Borales

Please update Packagist to reflect 0.3.0 tag

Eseperio avatar Oct 18 '19 11:10 Eseperio

@Borales maybe something went wrong with the GitHub Hook - latest version on packagist.org is 0.2.1 https://packagist.org/packages/borales/yii2-phone-input https://packagist.org/about#how-to-update-packages

Spell6inder avatar Oct 18 '19 12:10 Spell6inder

apologies, I had to upgrade Packagist webhooks, it's ok now

Borales avatar Oct 18 '19 12:10 Borales

0.3.0 tag doesn't contains @i-panov's fix. It works only with .min version.

nnrudakov avatar Nov 01 '19 17:11 nnrudakov