Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MaskedInput Widget javascript update request #19988

Closed
ldkafka opened this issue Oct 4, 2023 · 6 comments · Fixed by #20009
Closed

MaskedInput Widget javascript update request #19988

ldkafka opened this issue Oct 4, 2023 · 6 comments · Fixed by #20009

Comments

@ldkafka
Copy link

ldkafka commented Oct 4, 2023

Please update the MaskedInput Widget javascript version - the bundled one is version Version: 3.3.11 from 2017. Current one is 5.0.8 from 2023.

I am not sure if there are any breaking changes, but a lot of bugs have been fixed - including datetime extension formatting (which is how I figured out the bundled version is too old).

Also, the alias configuration is very ambiguous - the Widget uses the $aliases array to supposedly register aliases, but that in fact is never used - aliases have to be configured in the clientOptions directly.

Thank you!

@ldkafka ldkafka changed the title InputMask Widget javascript update request MaskedInput Widget javascript update request Oct 4, 2023
@bizley
Copy link
Member

bizley commented Oct 4, 2023

Hi, is there a chance you could prepare a PR fixing this?

@stovesy
Copy link

stovesy commented Oct 4, 2023

After this update I'm getting ...
Uncaught SyntaxError: expected expression, got '<'jquery.inputmask.bundle.js:1:3
Uncaught TypeError: jQuery(...).inputmask is not a function

After checking, the file jquery.inputmask.bundle.js doesnt exist in the asset cache..

@ldkafka
Copy link
Author

ldkafka commented Oct 4, 2023 via email

@stovesy
Copy link

stovesy commented Oct 4, 2023

class MaskedInputAsset extends AssetBundle
{
public $sourcePath = '@bower/inputmask/dist';
public $js = [
'jquery.inputmask.js',
];
public $depends = [
'yii\web\YiiAsset',
];
}

Fixes it for me, but I've no experience with this sort of thing.

@terabytesoftw
Copy link
Member

terabytesoftw commented Oct 14, 2023

@rob006 In the new version, change the name of the asset to:

'jquery.inputmask.bundle.js' to 'jquery.inputmask.js'

What is the best way to solve it, checking if the file exists, or deleting the old constraint, and leaving the new version.

@rob006
Copy link
Contributor

rob006 commented Oct 14, 2023

I don't know. IMO it shouldn't be part of the framework in the first place, so maybe extract this to separate package (which could have multiple versions targeting specific major version of inputmask plugin) and add it to require section of framework?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants