Skip to content

Commit e9b6914

Browse files
committed
fix: date-picker keydown event not work
1 parent 7b55c0d commit e9b6914

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

components/date-picker/createPicker.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,9 @@ export default function createPicker (TheCalendar, props) {
194194
return (
195195
<span
196196
class={props.pickerClass}
197-
onFocus={focus}
198-
onBlur={blur}
197+
// tabIndex={props.disabled ? -1 : 0}
198+
// onFocus={focus}
199+
// onBlur={blur}
199200
>
200201
<VcDatePicker
201202
{...vcDatePickerProps}

components/vc-calendar/src/Picker.jsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ const Picker = {
111111

112112
onKeyDown (event) {
113113
if (event.keyCode === KeyCode.DOWN && !this.sOpen) {
114-
this.open()
114+
this.openCalendar()
115115
event.preventDefault()
116116
}
117117
},
@@ -177,8 +177,8 @@ const Picker = {
177177
},
178178

179179
focusCalendar () {
180-
if (this.sOpen && this.calendarInstance && this.calendarInstance.context) {
181-
this.calendarInstance.context.focus()
180+
if (this.sOpen && this.calendarInstance && this.calendarInstance.componentInstance) {
181+
this.calendarInstance.componentInstance.focus()
182182
}
183183
},
184184
},

0 commit comments

Comments
 (0)