Skip to content

Commit bbb3a61

Browse files
tyao1facebook-github-bot
authored andcommitted
Fix inspecting on non-fabric
Summary: Changelog: [Category][Internal] - Fix inspecting on non-fabric the pointer events don't work on non-fabric components. In addition to check the pointer events feature flag, we need to check if fabric is on as well. Reviewed By: rbalicki2 Differential Revision: D41053393 fbshipit-source-id: ab47bd845b578a0859f282ea8ff04ddbff17da02
1 parent 5744b21 commit bbb3a61

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

Libraries/Inspector/DevtoolsOverlay.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const getInspectorDataForViewAtPoint = require('./getInspectorDataForViewAtPoint
2424
const {useEffect, useState, useCallback, useRef} = React;
2525

2626
const hook = window.__REACT_DEVTOOLS_GLOBAL_HOOK__;
27+
const isFabric = global.nativeFabricUIManager != null;
2728

2829
export default function DevtoolsOverlay({
2930
inspectedView,
@@ -179,17 +180,19 @@ export default function DevtoolsOverlay({
179180

180181
let highlight = inspected ? <ElementBox frame={inspected.frame} /> : null;
181182
if (isInspecting) {
182-
const events = ReactNativeFeatureFlags.shouldEmitW3CPointerEvents
183-
? {
184-
onPointerMove,
185-
onPointerDown: onPointerMove,
186-
onPointerUp: stopInspecting,
187-
}
188-
: {
189-
onStartShouldSetResponder: shouldSetResponser,
190-
onResponderMove: onResponderMove,
191-
onResponderRelease: stopInspecting,
192-
};
183+
const events =
184+
// Pointer events only work on fabric
185+
isFabric && ReactNativeFeatureFlags.shouldEmitW3CPointerEvents
186+
? {
187+
onPointerMove,
188+
onPointerDown: onPointerMove,
189+
onPointerUp: stopInspecting,
190+
}
191+
: {
192+
onStartShouldSetResponder: shouldSetResponser,
193+
onResponderMove: onResponderMove,
194+
onResponderRelease: stopInspecting,
195+
};
193196
return (
194197
<View
195198
nativeID="devToolsInspectorOverlay"

0 commit comments

Comments
 (0)