pull/1792/head
Cagatay Civici 2021-11-17 17:06:04 +03:00
parent d31f7b833f
commit ef32a2eed3
1 changed files with 9 additions and 13 deletions

View File

@ -316,7 +316,6 @@ export default {
overlay: null, overlay: null,
mask: null, mask: null,
timePickerTimer: null, timePickerTimer: null,
isKeydown: false,
created() { created() {
this.updateCurrentMetaData(); this.updateCurrentMetaData();
}, },
@ -1418,6 +1417,10 @@ export default {
} }
}, },
isValidSelection(value) { isValidSelection(value) {
if (value == null) {
return true;
}
let isValid = true; let isValid = true;
if (this.isSingleSelection()) { if (this.isSingleSelection()) {
if (!this.isSelectable(value.getDate(), value.getMonth(), value.getFullYear(), false)) { if (!this.isSelectable(value.getDate(), value.getMonth(), value.getFullYear(), false)) {
@ -2071,12 +2074,6 @@ export default {
} }
}, },
onInput(event) { onInput(event) {
// IE 11 Workaround for input placeholder : https://github.com/primefaces/primeng/issues/2026
if (!this.isKeydown) {
return;
}
this.isKeydown = false;
try { try {
this.selectionStart = this.$refs.input.$el.selectionStart; this.selectionStart = this.$refs.input.$el.selectionStart;
this.selectionEnd = this.$refs.input.$el.selectionEnd; this.selectionEnd = this.$refs.input.$el.selectionEnd;
@ -2087,9 +2084,9 @@ export default {
} }
} }
catch(err) { catch(err) {
// invalid date if (this.keepInvalid) {
let value = this.keepInvalid ? event.target.value : null; this.updateModel(event.target.value);
this.updateModel(value); }
} }
}, },
onFocus() { onFocus() {
@ -2101,8 +2098,7 @@ export default {
onBlur() { onBlur() {
this.focused = false; this.focused = false;
}, },
onKeyDown(event) { onKeyDown() {
this.isKeydown = true;
if (event.keyCode === 40 && this.overlay) { if (event.keyCode === 40 && this.overlay) {
this.trapFocus(event); this.trapFocus(event);
} }
@ -2198,7 +2194,7 @@ export default {
return propValue || new Date(); return propValue || new Date();
}, },
inputFieldValue() { inputFieldValue() {
return this.keepInvalid ? this.modelValue : this.formatValue(this.modelValue); return this.formatValue(this.modelValue);
}, },
containerClass() { containerClass() {
return [ return [