From a7080c6bc356b2ee36c07779cc8b1c75420866c4 Mon Sep 17 00:00:00 2001 From: Ruslan Lesiutin Date: Fri, 5 Dec 2025 12:38:52 +0000 Subject: [PATCH] fix[devtools]: still show overlay, if getClientRects is not implemented --- .../src/backend/views/Highlighter/index.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/react-devtools-shared/src/backend/views/Highlighter/index.js b/packages/react-devtools-shared/src/backend/views/Highlighter/index.js index 0adf3ff64ef6..bf579e8510f6 100644 --- a/packages/react-devtools-shared/src/backend/views/Highlighter/index.js +++ b/packages/react-devtools-shared/src/backend/views/Highlighter/index.js @@ -188,13 +188,12 @@ export default function setupHighlighter( typeof node.getClientRects === 'function' ? node.getClientRects() : []; - // If this is currently display: none, then try another node. - // This can happen when one of the host instances is a hoistable. if ( - nodeRects.length > 0 && - (nodeRects.length > 2 || - nodeRects[0].width > 0 || - nodeRects[0].height > 0) + typeof node.getClientRects === 'undefined' || // If Host doesn't implement getClientRects, try to show the overlay. + (nodeRects.length > 0 && // If this is currently display: none, then try another node. + (nodeRects.length > 2 || // This can happen when one of the host instances is a hoistable. + nodeRects[0].width > 0 || + nodeRects[0].height > 0)) ) { // $FlowFixMe[method-unbinding] if (scrollIntoView && typeof node.scrollIntoView === 'function') {