mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-09 22:50:21 +08:00
Fix setting js responder for null react view for tag
Reviewed By: kmagiera Differential Revision: D2637015 fb-gh-sync-id: 03af870cee82519ed34a4bbbcbd2c72146fcf00f
This commit is contained in:
committed by
facebook-github-bot-4
parent
d5daef08ef
commit
32c19c1994
@@ -186,14 +186,17 @@ public class UIViewOperationQueue {
|
||||
|
||||
private final class ChangeJSResponderOperation extends ViewOperation {
|
||||
|
||||
private final int mInitialTag;
|
||||
private final boolean mBlockNativeResponder;
|
||||
private final boolean mClearResponder;
|
||||
|
||||
public ChangeJSResponderOperation(
|
||||
int tag,
|
||||
int initialTag,
|
||||
boolean clearResponder,
|
||||
boolean blockNativeResponder) {
|
||||
super(tag);
|
||||
mInitialTag = initialTag;
|
||||
mClearResponder = clearResponder;
|
||||
mBlockNativeResponder = blockNativeResponder;
|
||||
}
|
||||
@@ -201,7 +204,7 @@ public class UIViewOperationQueue {
|
||||
@Override
|
||||
public void execute() {
|
||||
if (!mClearResponder) {
|
||||
mNativeViewHierarchyManager.setJSResponder(mTag, mBlockNativeResponder);
|
||||
mNativeViewHierarchyManager.setJSResponder(mTag, mInitialTag, mBlockNativeResponder);
|
||||
} else {
|
||||
mNativeViewHierarchyManager.clearJSResponder();
|
||||
}
|
||||
@@ -450,14 +453,21 @@ public class UIViewOperationQueue {
|
||||
mOperations.add(new RemoveRootViewOperation(rootViewTag));
|
||||
}
|
||||
|
||||
public void enqueueSetJSResponder(int reactTag, boolean blockNativeResponder) {
|
||||
public void enqueueSetJSResponder(
|
||||
int tag,
|
||||
int initialTag,
|
||||
boolean blockNativeResponder) {
|
||||
mOperations.add(
|
||||
new ChangeJSResponderOperation(reactTag, false /*clearResponder*/, blockNativeResponder));
|
||||
new ChangeJSResponderOperation(
|
||||
tag,
|
||||
initialTag,
|
||||
false /*clearResponder*/,
|
||||
blockNativeResponder));
|
||||
}
|
||||
|
||||
public void enqueueClearJSResponder() {
|
||||
// Tag is 0 because JSResponderHandler doesn't need one in order to clear the responder.
|
||||
mOperations.add(new ChangeJSResponderOperation(0, true /*clearResponder*/, false));
|
||||
mOperations.add(new ChangeJSResponderOperation(0, 0, true /*clearResponder*/, false));
|
||||
}
|
||||
|
||||
public void enqueueDispatchCommand(
|
||||
|
||||
Reference in New Issue
Block a user