diff --git a/lib/DatePickerItem.js b/lib/DatePickerItem.js index fbd402b..543d70a 100644 --- a/lib/DatePickerItem.js +++ b/lib/DatePickerItem.js @@ -170,13 +170,19 @@ class DatePickerItem extends Component { } handleStart(event) { - this.touchY = event.pageY || event.targetTouches[0].pageY; + this.touchY = + (event.targetTouches && event.targetTouches[0] && event.targetTouches[0].pageY) || + event.pageY; + this.translateY = this.state.translateY; } handleMove(event) { - const touchY = event.pageY || event.targetTouches[0].pageY; + const touchY = + (event.targetTouches && event.targetTouches[0] && event.targetTouches[0].pageY) || + event.pageY; + const dir = touchY - this.touchY; const translateY = this.translateY + dir; const direction = dir > 0 ? -1 : 1;