Borales / yii2-phone-input

Yii2 International telephone numbers
Other
135 stars 55 forks source link

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

Open i-panov opened 6 years ago

i-panov commented 6 years ago
  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 commented 6 years ago

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 commented 6 years ago

@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.

Borales commented 6 years ago

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

Buliwyfa commented 5 years ago

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
alireza-salehi commented 5 years ago

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

andrey-denisenko commented 5 years ago

Issue appeared a year ago. And it still there!

Borales commented 5 years ago

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

Eseperio commented 5 years ago

Please update Packagist to reflect 0.3.0 tag

Spell6inder commented 5 years ago

@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

Borales commented 5 years ago

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

nnrudakov commented 5 years ago

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