diff --git a/index.js b/index.js index 549d2cf..8f0a5bf 100644 --- a/index.js +++ b/index.js @@ -2,11 +2,12 @@ * Created by lvbingru on 12/16/15. */ -import React, { Component, PropTypes } from 'react'; +import React, { Component } from 'react'; import ReactNative, { InteractionManager, View, Text, ScrollView, Platform, Animated, UIManager, NativeModules, Dimensions, Keyboard, } from 'react-native'; +import PropTypes from 'prop-types'; import TextInputState from 'react-native/Libraries/Components/TextInput/TextInputState'; const ViewPlugins = NativeModules.InputScrollViewPlugin; const dismissKeyboard = Keyboard.dismiss; @@ -47,7 +48,7 @@ export default class InputScrollView extends Component { if (!this.scrollViewRef) { return; } - const currentlyFocusedTextInput = TextInputState.currentlyFocusedField(); + const currentlyFocusedTextInput = TextInputState.currentlyFocusedInput(); if (currentlyFocusedTextInput != null) { ViewPlugins && ViewPlugins.isSubview( currentlyFocusedTextInput, @@ -76,7 +77,7 @@ export default class InputScrollView extends Component { style={{ flex: 1 }} onStartShouldSetResponderCapture={e => { if (tapToDismiss === true) { - const currentlyFocusedTextInput = TextInputState.currentlyFocusedField(); + const currentlyFocusedTextInput = TextInputState.currentlyFocusedInput(); if (e.target != currentlyFocusedTextInput) { if (ViewPlugins && ViewPlugins.isTextInput) { ViewPlugins.isTextInput(