Bug 1532397 - Fix multiple highlight issues in debugger r=jlast

https://github.com/firefox-devtools/debugger/issues/7954

Differential Revision: https://phabricator.services.mozilla.com/D21989

--HG--
extra : moz-landing-system : lando
This commit is contained in:
David Walsh 2019-03-05 00:33:08 +00:00
parent d3a1bdd83c
commit f0e5e29f4f

View File

@ -50,10 +50,14 @@ function inPopup(e) {
function getElementFromPos(pos: DOMRect) {
// $FlowIgnore
return document.elementFromPoint(
// 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(
pos.x + pos.width / 2,
pos.y + pos.height / 2
);
)];
return elementsAtPoint.find(el => el.className.startsWith("cm-"));
}
class Preview extends PureComponent<Props, State> {