Metro-UI-CSS
Metro-UI-CSS copied to clipboard
Validator does not add invalid class to type file
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