更新 index.js
This commit is contained in:
parent
7aca6da05f
commit
9f6cc8f15b
7
index.js
7
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(
|
||||
|
|
|
|||
Loading…
Reference in New Issue