From 9f6cc8f15b8eba912e56812fa4233b01d4271a46 Mon Sep 17 00:00:00 2001 From: lvwang2002 Date: Thu, 28 Mar 2024 16:58:13 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20index.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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(