Skip to content

Commit

Permalink
Fixed #1712, Fixed #1713
Browse files Browse the repository at this point in the history
  • Loading branch information
cagataycivici committed Nov 17, 2021
1 parent d31f7b8 commit ef32a2e
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions src/components/calendar/Calendar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,6 @@ export default {
overlay: null,
mask: null,
timePickerTimer: null,
isKeydown: false,
created() {
this.updateCurrentMetaData();
},
Expand Down Expand Up @@ -1418,6 +1417,10 @@ export default {
}
},
isValidSelection(value) {
if (value == null) {
return true;
}
let isValid = true;
if (this.isSingleSelection()) {
if (!this.isSelectable(value.getDate(), value.getMonth(), value.getFullYear(), false)) {
Expand Down Expand Up @@ -2071,12 +2074,6 @@ export default {
}
},
onInput(event) {
// IE 11 Workaround for input placeholder : https://github.com/primefaces/primeng/issues/2026
if (!this.isKeydown) {
return;
}
this.isKeydown = false;
try {
this.selectionStart = this.$refs.input.$el.selectionStart;
this.selectionEnd = this.$refs.input.$el.selectionEnd;
Expand All @@ -2087,9 +2084,9 @@ export default {
}
}
catch(err) {
// invalid date
let value = this.keepInvalid ? event.target.value : null;
this.updateModel(value);
if (this.keepInvalid) {
this.updateModel(event.target.value);
}
}
},
onFocus() {
Expand All @@ -2101,8 +2098,7 @@ export default {
onBlur() {
this.focused = false;
},
onKeyDown(event) {
this.isKeydown = true;
onKeyDown() {

This comment has been minimized.

Copy link
@samueleiche

samueleiche Nov 25, 2021

"event" argument was removed here, but the code below still uses it

if (event.keyCode === 40 && this.overlay) {
this.trapFocus(event);
}
Expand Down Expand Up @@ -2198,7 +2194,7 @@ export default {
return propValue || new Date();
},
inputFieldValue() {
return this.keepInvalid ? this.modelValue : this.formatValue(this.modelValue);
return this.formatValue(this.modelValue);
},
containerClass() {
return [
Expand Down

0 comments on commit ef32a2e

Please sign in to comment.