fix: date-picker keydown event not work

pull/29/head
tangjinzhou 2018-05-24 18:49:04 +08:00
parent 7b55c0d2fb
commit e9b6914282
2 changed files with 6 additions and 5 deletions

View File

@ -194,8 +194,9 @@ export default function createPicker (TheCalendar, props) {
return ( return (
<span <span
class={props.pickerClass} class={props.pickerClass}
onFocus={focus} // tabIndex={props.disabled ? -1 : 0}
onBlur={blur} // onFocus={focus}
// onBlur={blur}
> >
<VcDatePicker <VcDatePicker
{...vcDatePickerProps} {...vcDatePickerProps}

View File

@ -111,7 +111,7 @@ const Picker = {
onKeyDown (event) { onKeyDown (event) {
if (event.keyCode === KeyCode.DOWN && !this.sOpen) { if (event.keyCode === KeyCode.DOWN && !this.sOpen) {
this.open() this.openCalendar()
event.preventDefault() event.preventDefault()
} }
}, },
@ -177,8 +177,8 @@ const Picker = {
}, },
focusCalendar () { focusCalendar () {
if (this.sOpen && this.calendarInstance && this.calendarInstance.context) { if (this.sOpen && this.calendarInstance && this.calendarInstance.componentInstance) {
this.calendarInstance.context.focus() this.calendarInstance.componentInstance.focus()
} }
}, },
}, },