We recently encountered a strange bug in our web application that is specific to Internet Explorer. The input validation, demonstrated in this plunker, functions correctly on all browsers except IE (which we need to support from version 10 and above). Our inputs using type="number"
for numerical data entry work smoothly in most browsers, ensuring that users only input valid characters. Additionally, we utilize ng-pattern="/^\d+$/"
to further validate the allowed number formats, as the input type is not fully supported in IE.
The issue arises when entering letters as the first characters of an input, like "abb45". Surprisingly, IE does not recognize this as an invalid input. I read on a Stack Overflow thread that adding required
to the input triggers proper validation, but this field is not mandatory for us. Furthermore, even if the input is marked as invalid, the error message does not display (the source of this validation error remains unclear).
A temporary fix involves removing type="number"
which resolves the problem in IE. However, we are exploring other solutions to avoid disrupting the smooth functionality of numeric inputs in other browsers before resorting to this change.
Please note that we do not rely on jQuery (only jQuery lite since it is a dependency of Angular).