Skip to content

Commit

Permalink
fix: date-picker keydown event not work
Browse files Browse the repository at this point in the history
  • Loading branch information
tangjinzhou committed May 24, 2018
1 parent 7b55c0d commit e9b6914
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions components/date-picker/createPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,9 @@ export default function createPicker (TheCalendar, props) {
return (
<span
class={props.pickerClass}
onFocus={focus}
onBlur={blur}
// tabIndex={props.disabled ? -1 : 0}
// onFocus={focus}
// onBlur={blur}
>
<VcDatePicker
{...vcDatePickerProps}
Expand Down
6 changes: 3 additions & 3 deletions components/vc-calendar/src/Picker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ const Picker = {

onKeyDown (event) {
if (event.keyCode === KeyCode.DOWN && !this.sOpen) {
this.open()
this.openCalendar()
event.preventDefault()
}
},
Expand Down Expand Up @@ -177,8 +177,8 @@ const Picker = {
},

focusCalendar () {
if (this.sOpen && this.calendarInstance && this.calendarInstance.context) {
this.calendarInstance.context.focus()
if (this.sOpen && this.calendarInstance && this.calendarInstance.componentInstance) {
this.calendarInstance.componentInstance.focus()
}
},
},
Expand Down

0 comments on commit e9b6914

Please sign in to comment.