mdPickers icon indicating copy to clipboard operation
mdPickers copied to clipboard

Required validation error message appearing by loading of the page in IE browser

Open dmopuri opened this issue 8 years ago • 2 comments

"This is required" validation message appears by loading of the page, even though users didn't started typing any input. This is just happening in IE browser. When we have a placeholder attribute to a date picker it is triggering input event and performing required validation.

dmopuri avatar Aug 09 '16 18:08 dmopuri

+1

danielso2007 avatar Aug 26 '16 22:08 danielso2007

In "mdPickers.js" file, called the method "function updateDate (date) {..." Line: module.directive ( "mdpDatePicker" ....

It will be temporary, until the bug is fixed.

Example:

" updateDate function (date) {
                    var value = moment (date, angular.isDate (date) null: scope.dateFormat, true)
                        strValue = value.format (scope.dateFormat);
                    if (value.isValid ()) {
                        updateInputElement (strValue);
                        . NgModel $ setViewValue (strValue);
                    } Else {
                        updateInputElement (date);
                        . NgModel $ setViewValue (date);
                    }
                    if (! ngModel. $ pristine &&
                        messages.hasClass ( "md-auto-hide") &&
                        inputContainer.hasClass ( "md-input-invalid")) messages.removeClass ( "md-auto-hide");
                    ngModel $ render ().;
                }
                //FIXME: After this call, validation worked properly.
                updateDate (moment (ngModel $ modelValue) .toDate ().);
"

danielso2007 avatar Aug 26 '16 22:08 danielso2007