Skip to content

Commit

Permalink
fix(devtools): highlighter should only show the hovered component's n…
Browse files Browse the repository at this point in the history
…ame (#44863)

The used children property on a HTMLCollection does not contain text elements. Because of this, the highlighter overlay text never got fully cleared.

PR Close #44863
  • Loading branch information
JimMorrison723 authored and thePunderWoman committed Feb 1, 2022
1 parent 2006f53 commit d41dedb
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions devtools/projects/ng-devtools-backend/src/lib/highlighter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,7 @@ function showOverlay(
overlay.style.top = ~~top + 'px';
overlay.style.left = ~~left + 'px';

while (overlayContent.children.length) {
const {children} = overlayContent;
overlayContent.removeChild(children[children.length - 1]);
}
overlayContent.replaceChildren();

content.forEach((child) => overlayContent.appendChild(child));

Expand Down

0 comments on commit d41dedb

Please sign in to comment.