Skip to content

Commit

Permalink
fix: DatePicker Keyboard error
Browse files Browse the repository at this point in the history
  • Loading branch information
wangdaodao committed Feb 28, 2024
1 parent 290e68e commit 5baaca2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/date-picker/src/panel/date.vue
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,10 @@
},
handleKeyControl(keyCode) {
const mode = this.selectionMode;
if (mode === 'dates' || mode === 'months' || mode === 'years') {
return;
};
const mapping = {
'year': {
38: -4, 40: 4, 37: -1, 39: 1, offset: (date, step) => date.setFullYear(date.getFullYear() + step)
Expand All @@ -450,7 +454,6 @@
38: -7, 40: 7, 37: -1, 39: 1, offset: (date, step) => date.setDate(date.getDate() + step)
}
};
const mode = this.selectionMode;
const year = 3.1536e10;
const now = this.date.getTime();
const newDate = new Date(this.date.getTime());
Expand Down

0 comments on commit 5baaca2

Please sign in to comment.