Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: stop using ReactNativeComponentTree
  • Loading branch information
aleclarson committed Jan 29, 2019
commit a9c22664adf37e962f5aa884185e46b405c66886
15 changes: 1 addition & 14 deletions Libraries/Components/ScrollResponder.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const performanceNow = require('fbjs/lib/performanceNow');
const warning = require('fbjs/lib/warning');

const { ScrollViewManager } = require('NativeModules');
const { getInstanceFromNode } = require('ReactNativeComponentTree');

/**
* Mixin that can be integrated in order to handle scrolling that plays well
Expand Down Expand Up @@ -117,15 +116,6 @@ type State = {
};
type Event = Object;

function isTagInstanceOfTextInput(tag) {
const instance = getInstanceFromNode(tag);
return instance && instance.viewConfig && (
instance.viewConfig.uiViewClassName === 'AndroidTextInput' ||
instance.viewConfig.uiViewClassName === 'RCTMultilineTextInputView' ||
instance.viewConfig.uiViewClassName === 'RCTSinglelineTextInputView'
);
}

const ScrollResponderMixin = {
mixins: [Subscribable.Mixin],
scrollResponderMixinGetInitialState: function(): State {
Expand Down Expand Up @@ -208,10 +198,7 @@ const ScrollResponderMixin = {
const {keyboardShouldPersistTaps} = this.props;
const keyboardNeverPersistTaps = !keyboardShouldPersistTaps ||
keyboardShouldPersistTaps === 'never';
if (keyboardNeverPersistTaps &&
currentlyFocusedTextInput != null &&
!isTagInstanceOfTextInput(e.target)
) {
if (keyboardNeverPersistTaps && currentlyFocusedTextInput != null) {
return true;
}
return this.scrollResponderIsAnimating();
Expand Down