Skip to content

Commit bfb36c2

Browse files
tyao1facebook-github-bot
authored andcommitted
Stop inspecting when an element is selected
Summary: Changelog: [General][Fixed] In RN devtools, call that method, and then set component state to not inspecting. Reviewed By: lunaruan Differential Revision: D38852009 fbshipit-source-id: d14bd4cc4461f0f7ec4ae9cd6098a58eef3e6ab9
1 parent 6163029 commit bfb36c2

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

Libraries/Inspector/DevtoolsOverlay.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,15 @@ export default function DevtoolsOverlay({
122122
locationY,
123123
viewData => {
124124
const {touchedViewTag, closestInstance} = viewData;
125-
if (closestInstance != null) {
126-
// Fabric
127-
agent.selectNode(closestInstance);
128-
return true;
129-
} else if (touchedViewTag != null) {
130-
agent.selectNode(findNodeHandle(touchedViewTag));
125+
if (closestInstance != null || touchedViewTag != null) {
126+
if (closestInstance != null) {
127+
// Fabric
128+
agent.selectNode(closestInstance);
129+
} else {
130+
agent.selectNode(findNodeHandle(touchedViewTag));
131+
}
132+
agent.stopInspectingNative(true);
133+
setIsInspecting(false);
131134
return true;
132135
}
133136
return false;

0 commit comments

Comments
 (0)