Skip to content

Commit 88027c3

Browse files
committed
fix[devtools/useModalDismissSignal]: use getRootNode for shadow root case support (#28145)
In our custom implementation for handling modals dismiss signal, we use element's `ownerDocument` field, which expectedly doesn't work well with shadow root. Now using [`getRootNode`](https://developer.mozilla.org/en-US/docs/Web/API/Node/getRootNode) instead of `ownerDocument` to support shadow root case. Without this, if RDT Frontend is hosted inside the shadow root, the modal gets closed after any click, including on the buttons hosted by modal: https://github.com/facebook/react/blob/00d42ac3542179c55f936f395ede7abaeb5900a3/packages/react-devtools-shared/src/devtools/views/hooks.js#L228-L238 Test plan: - Modals work as expected for Chrome DevTools integration - Modals work as expected at every other surfaces: browser extension, electron wrapper for RN, inline version for web DiffTrain build for commit 947e796.
1 parent f0ea64f commit 88027c3

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25721,7 +25721,7 @@ if (__DEV__) {
2572125721
return root;
2572225722
}
2572325723

25724-
var ReactVersion = "18.3.0-canary-269edb88b-20240211";
25724+
var ReactVersion = "18.3.0-canary-947e7962a-20240212";
2572525725

2572625726
// Might add PROFILE later.
2572725727

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9173,7 +9173,7 @@ var devToolsConfig$jscomp$inline_1023 = {
91739173
throw Error("TestRenderer does not support findFiberByHostInstance()");
91749174
},
91759175
bundleType: 0,
9176-
version: "18.3.0-canary-269edb88b-20240211",
9176+
version: "18.3.0-canary-947e7962a-20240212",
91779177
rendererPackageName: "react-test-renderer"
91789178
};
91799179
var internals$jscomp$inline_1204 = {
@@ -9204,7 +9204,7 @@ var internals$jscomp$inline_1204 = {
92049204
scheduleRoot: null,
92059205
setRefreshHandler: null,
92069206
getCurrentFiber: null,
9207-
reconcilerVersion: "18.3.0-canary-269edb88b-20240211"
9207+
reconcilerVersion: "18.3.0-canary-947e7962a-20240212"
92089208
};
92099209
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
92109210
var hook$jscomp$inline_1205 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9601,7 +9601,7 @@ var devToolsConfig$jscomp$inline_1065 = {
96019601
throw Error("TestRenderer does not support findFiberByHostInstance()");
96029602
},
96039603
bundleType: 0,
9604-
version: "18.3.0-canary-269edb88b-20240211",
9604+
version: "18.3.0-canary-947e7962a-20240212",
96059605
rendererPackageName: "react-test-renderer"
96069606
};
96079607
var internals$jscomp$inline_1245 = {
@@ -9632,7 +9632,7 @@ var internals$jscomp$inline_1245 = {
96329632
scheduleRoot: null,
96339633
setRefreshHandler: null,
96349634
getCurrentFiber: null,
9635-
reconcilerVersion: "18.3.0-canary-269edb88b-20240211"
9635+
reconcilerVersion: "18.3.0-canary-947e7962a-20240212"
96369636
};
96379637
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
96389638
var hook$jscomp$inline_1246 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-dev.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if (__DEV__) {
2424
) {
2525
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
2626
}
27-
var ReactVersion = "18.3.0-canary-269edb88b-20240211";
27+
var ReactVersion = "18.3.0-canary-947e7962a-20240212";
2828

2929
// ATTENTION
3030
// When adding new symbols to this file,

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-prod.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -551,4 +551,4 @@ exports.useSyncExternalStore = function (
551551
exports.useTransition = function () {
552552
return ReactCurrentDispatcher.current.useTransition();
553553
};
554-
exports.version = "18.3.0-canary-269edb88b-20240211";
554+
exports.version = "18.3.0-canary-947e7962a-20240212";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-profiling.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ exports.useSyncExternalStore = function (
547547
exports.useTransition = function () {
548548
return ReactCurrentDispatcher.current.useTransition();
549549
};
550-
exports.version = "18.3.0-canary-269edb88b-20240211";
550+
exports.version = "18.3.0-canary-947e7962a-20240212";
551551
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
552552
"function" ===
553553
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
269edb88b28b7394335fb504d9924acd35d4ef38
1+
947e7962ad43bd0fe8826c48d94a9df8d5206850

0 commit comments

Comments
 (0)