Skip to content

Commit

Permalink
fix: can't clear input box
Browse files Browse the repository at this point in the history
  • Loading branch information
mengxiong10 committed Dec 2, 2019
1 parent 4d935d7 commit 52bd1fe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/date-picker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ export default {
return this.value2date(this.value);
},
text() {
if (this.userInput) {
if (this.userInput !== null) {
return this.userInput;
}
if (!this.isValidValue(this.innerValue)) {
Expand Down Expand Up @@ -343,6 +343,8 @@ export default {
}
},
emitValue(date, type) {
// fix IE11/10 trigger input event when input is focused. (placeholder !== '')
this.userInput = null;
const value = Array.isArray(date) ? date.map(this.date2value) : this.date2value(date);
this.$emit('input', value);
this.$emit('change', value, type);
Expand Down

0 comments on commit 52bd1fe

Please sign in to comment.