Fixed #70 - Poor handling of user input on Calendar

pull/104/head
mertsincan 2019-10-22 13:54:17 +03:00
parent c069311169
commit e0aa79469d
1 changed files with 9 additions and 2 deletions

View File

@ -312,6 +312,7 @@ export default {
}
}
},
oldViewDate: null,
created() {
this.updateCurrentMetaData();
this.updateInputFieldValue(this.value);
@ -349,7 +350,7 @@ export default {
watch: {
value(newValue) {
this.updateCurrentMetaData();
this.updateInputFieldValue(newValue);
this.updateInputFieldValue(newValue || this.inputFieldValue);
}
},
methods: {
@ -1541,6 +1542,7 @@ export default {
catch(err) {
//invalid date
$vm.updateModel(null);
$vm.inputFieldValue = val;
}
},
focus: event => {
@ -1579,12 +1581,17 @@ export default {
};
},
viewDate() {
let $vm = this;
let propValue = this.value;
if (propValue && Array.isArray(propValue)) {
propValue = propValue[0];
}
return propValue || new Date();
let vDate = propValue || $vm.oldViewDate || new Date();
$vm.oldViewDate = vDate;
return vDate;
},
containerClass() {
return [