Update index.js

增加判断条件
This commit is contained in:
huip 2016-08-24 16:46:48 +08:00 committed by GitHub
parent 774d39a8eb
commit 55561d28c9
1 changed files with 1 additions and 1 deletions

View File

@ -112,7 +112,7 @@ export default class InputScrollView extends Component {
e=>{console.warning(e)},
(left, top, width, height)=>{
let keyboardScreenY = Dimensions.get('window').height;
if (e.endCoordinates) {
if (e && e.endCoordinates) {
keyboardScreenY = e.endCoordinates.screenY;
}
let scrollOffsetY = top - keyboardScreenY + height + this.props.distance;