The function of validation of input fields.
function validateValue() { return { restrict: 'A', require: 'ngModel', link: function(scope, elem, attrs, ctrl) { var regex = new RegExp(/^\d{1,}((\.|,)\d{1,4})?$/); var regexNoLetters = /[a-zA-Zа-я-А-Я]/g; var re = /^(\d{1,5}[.,]\d{4})[\s\S]*/; ctrl.$validators.validateAmount = function(value) { if (ctrl.$viewValue == 0) { return false; } if (value) { var value = value.toString().replace(regexNoLetters, '').replace(',', '.'); var result = value.replace(re, '$1'); ctrl.$setValidity('amount', true); ctrl.$setViewValue(result); if (!regex.test(result)) { ctrl.$setTouched(); } ctrl.$render(); return !value ? true : regex.test(result); } else { return false; } } } }; everything works fine in chrome and similar browsers. The problem is safari. There is no way to put "." that is, a fractional number. I can not understand what the problem is. At what in a safari on a poppy 17 "everything is normal. And on 13" a problem. I know that on 13 "there are other jokes too. Can anyone know what the problem is with them? In general, I found out that in safari it does the opposite. Instead of blocking all unnecessary characters," "replace with". "It turns out that." and, "block and the rest of the characters and letters can be entered. What's wrong?