From 828c0b965d3296eb7680c32d58d727342d1b9ab1 Mon Sep 17 00:00:00 2001 From: Bryan Matthews Date: Fri, 11 Sep 2020 08:42:06 -0400 Subject: [PATCH 1/2] DatePicker: Don't select date with Enter key This is now redundant, since arrow keys immediately emit the selected date. The effect is that in other contexts (ex: when navigating using the prev/next links), when enter is pressed it selects the highlighted date in addition to any other action that it would normally do. --- packages/date-picker/src/panel/date.vue | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/date-picker/src/panel/date.vue b/packages/date-picker/src/panel/date.vue index a3027033c0..fae086aefc 100644 --- a/packages/date-picker/src/panel/date.vue +++ b/packages/date-picker/src/panel/date.vue @@ -462,9 +462,6 @@ event.stopPropagation(); event.preventDefault(); } - if (keyCode === 13 && this.userInputDate === null && this.userInputTime === null) { // Enter - this.emit(this.date, false); - } } }, From 7fc05e79e797eabc121e78f0227a976d83a5652b Mon Sep 17 00:00:00 2001 From: Bryan Matthews Date: Fri, 11 Sep 2020 09:35:22 -0400 Subject: [PATCH 2/2] DatePicker: Only take into account the actual selected value for the "current" class logic --- packages/date-picker/src/basic/date-table.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/date-picker/src/basic/date-table.vue b/packages/date-picker/src/basic/date-table.vue index ccef31f3a6..e77ab07f9b 100644 --- a/packages/date-picker/src/basic/date-table.vue +++ b/packages/date-picker/src/basic/date-table.vue @@ -267,7 +267,7 @@ classes.push('default'); } - if (selectionMode === 'day' && (cell.type === 'normal' || cell.type === 'today') && this.cellMatchesDate(cell, this.date || this.value)) { + if (selectionMode === 'day' && (cell.type === 'normal' || cell.type === 'today') && this.cellMatchesDate(cell, this.value)) { classes.push('current'); }