Skip to content

Commit 0f69781

Browse files
committed
fix: stop using ReactNativeComponentTree
Copied from: react/react-native@a275eac
1 parent 1747f2b commit 0f69781

1 file changed

Lines changed: 1 addition & 14 deletions

File tree

Libraries/Components/ScrollResponder.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ const performanceNow = require('fbjs/lib/performanceNow');
2626
const warning = require('fbjs/lib/warning');
2727

2828
const { ScrollViewManager } = require('NativeModules');
29-
const { getInstanceFromNode } = require('ReactNativeComponentTree');
3029

3130
/**
3231
* Mixin that can be integrated in order to handle scrolling that plays well
@@ -117,15 +116,6 @@ type State = {
117116
};
118117
type Event = Object;
119118

120-
function isTagInstanceOfTextInput(tag) {
121-
const instance = getInstanceFromNode(tag);
122-
return instance && instance.viewConfig && (
123-
instance.viewConfig.uiViewClassName === 'AndroidTextInput' ||
124-
instance.viewConfig.uiViewClassName === 'RCTMultilineTextInputView' ||
125-
instance.viewConfig.uiViewClassName === 'RCTSinglelineTextInputView'
126-
);
127-
}
128-
129119
const ScrollResponderMixin = {
130120
mixins: [Subscribable.Mixin],
131121
scrollResponderMixinGetInitialState: function(): State {
@@ -208,10 +198,7 @@ const ScrollResponderMixin = {
208198
const {keyboardShouldPersistTaps} = this.props;
209199
const keyboardNeverPersistTaps = !keyboardShouldPersistTaps ||
210200
keyboardShouldPersistTaps === 'never';
211-
if (keyboardNeverPersistTaps &&
212-
currentlyFocusedTextInput != null &&
213-
!isTagInstanceOfTextInput(e.target)
214-
) {
201+
if (keyboardNeverPersistTaps && currentlyFocusedTextInput != null) {
215202
return true;
216203
}
217204
return this.scrollResponderIsAnimating();

0 commit comments

Comments
 (0)