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

Validator does not add invalid class to type file #1892

Open
bogozaur opened this issue Jan 23, 2023 · 0 comments
Open

Validator does not add invalid class to type file #1892

bogozaur opened this issue Jan 23, 2023 · 0 comments

Comments

@bogozaur
Copy link

When using the validator and add required to a type="file" input with data-role="file", in case there is no file selected, the field is not marked as invalid (the invalid class is not added to the visible element). The invalid class is added directly to the input file that is hidden.

To Reproduce
Create a input field:

Expected behavior
The invalid class should be added to the parent of the file input element.

Where is the problem
The problem is in is_control function:
is_control: function(el){
return el.parent().hasClass("input")
|| el.parent().hasClass("select")
|| el.parent().hasClass("textarea")
|| el.parent().hasClass("checkbox")
|| el.parent().hasClass("switch")
|| el.parent().hasClass("radio")
|| el.parent().hasClass("spinner")
;
},

The || el.parent().hasClass("file") file should be included here

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

1 participant