Skip to content

Commit

Permalink
Stop inspecting when an element is selected
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tyao1 authored and facebook-github-bot committed Sep 12, 2022
1 parent 6163029 commit bfb36c2
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Libraries/Inspector/DevtoolsOverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,15 @@ export default function DevtoolsOverlay({
locationY,
viewData => {
const {touchedViewTag, closestInstance} = viewData;
if (closestInstance != null) {
// Fabric
agent.selectNode(closestInstance);
return true;
} else if (touchedViewTag != null) {
agent.selectNode(findNodeHandle(touchedViewTag));
if (closestInstance != null || touchedViewTag != null) {
if (closestInstance != null) {
// Fabric
agent.selectNode(closestInstance);
} else {
agent.selectNode(findNodeHandle(touchedViewTag));
}
agent.stopInspectingNative(true);
setIsInspecting(false);
return true;
}
return false;
Expand Down

0 comments on commit bfb36c2

Please sign in to comment.