diff --git a/devtools/client/debugger/new/src/components/Editor/Preview/index.js b/devtools/client/debugger/new/src/components/Editor/Preview/index.js index bc2ae087ab4c..bfcb2b7aacb4 100644 --- a/devtools/client/debugger/new/src/components/Editor/Preview/index.js +++ b/devtools/client/debugger/new/src/components/Editor/Preview/index.js @@ -50,14 +50,10 @@ function inPopup(e) { function getElementFromPos(pos: DOMRect) { // $FlowIgnore - // We need to use element*s*AtPoint because the tooltip overlays - // the token and thus an undesirable element may be returned - const elementsAtPoint = [...document.elementsFromPoint( + return document.elementFromPoint( pos.x + pos.width / 2, pos.y + pos.height / 2 - )]; - - return elementsAtPoint.find(el => el.className.startsWith("cm-")); + ); } class Preview extends PureComponent {