更新 index.js

This commit is contained in:
lvwang2002 2024-03-28 16:58:13 +00:00
parent 7aca6da05f
commit 9f6cc8f15b
1 changed files with 4 additions and 3 deletions

View File

@ -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(