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 #20211

Closed
alxlnk opened this issue Jun 24, 2024 · 4 comments
Closed

MaskedInput #20211

alxlnk opened this issue Jun 24, 2024 · 4 comments
Milestone

Comments

@alxlnk
Copy link
Contributor

alxlnk commented Jun 24, 2024

What steps will reproduce the problem?

Upgrade Yii to 2.0.50 version

What is the expected result?

Masked input with regex must work

What do you get instead?

MaskedInput initialization throws error

Additional info

jquery: 3.6.4
inputmask: 5.0.8

https://jsfiddle.net/4jx0pqgw/

Need to add the regex parameter to required list in initialization.

Q A
Yii version 2.0.50
PHP version 7.4.27
Operating system Windows
@marcovtwout
Copy link
Member

@alxlnk Could you clarify: was this still working on 2.0.49 and is this a regression? Or was it already broken?

@alxlnk
Copy link
Contributor Author

alxlnk commented Jul 9, 2024

@marcovtwout My last update Yii is from 2.0.49.3 to 2.0.50. 2.0.49.3 version require "bower-asset/inputmask": "~3.2.2 | ~3.3.5" and regex with alias works in MaskedInput widget, but 2.0.50 require "bower-asset/inputmask": "^5.0.8 " and it broken my previous widget config.

@alxlnk
Copy link
Contributor Author

alxlnk commented Jul 9, 2024

PR #20212 already merged and resolve configuration issue.

@alxlnk
Copy link
Contributor Author

alxlnk commented Jul 9, 2024

To work correctly in version 2.0.50 you need to use the following widget configuration:

[
    'aliases' => [
        'regex' => [
            'regex' => '^.*$',
        ],
    ],
    'clientOptions' => [
        'alias' => 'regex',
    ],
]

but more simplify and valid is

[
    'clientOptions' => [
        'regex' => '^.*$',
    ],
]

@samdark samdark closed this as completed Jul 10, 2024
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

No branches or pull requests

3 participants