-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Description
Inside bindChangeEvent you are checking if date is invalid with checkDate and if so you return back without triggering change event even though you are changing date inside checkDate:
checkDate: function (day, month, year) {
var invalidDate;
if (month !== '00') {
var numDaysInMonth = (new Date(year, month, 0).getDate()),
selectedDayInt = parseInt(day, 10);
invalidDate = this.updateDayOptions(numDaysInMonth, selectedDayInt);
// If the date is invalid, empty the hidden field to prevent invalid submissions
if (invalidDate) {
this.internals.objectRefs.hiddenField.val('');
}
}
return invalidDate;
}
We should add:
this.internals.objectRefs.hiddenField.change();
right after this.internals.objectRefs.hiddenField.val('');
OR
Add it inside bindChangeEvent just before return false.
if (invalidDate) {
objectRefs.dayDropdown.addClass('invalid');
return false;
}
This causes that in case you select December 31st and you switch to february, change event won't be triggered even though is invalid date. But I think it really should
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels