From 01bbafd47eeea2496fcd3d536947307567fa1ce4 Mon Sep 17 00:00:00 2001 From: hawkgs Date: Mon, 1 Sep 2025 17:07:26 +0300 Subject: [PATCH] fix(devtools): runtime errors caused by tree node snapping and tab change (#63531) Fix the runtime errors caused by the tree visualizer node auto-snapping when a tab is changed. The errors are caused since we only visually hide the tabs. PR Close #63531 --- .../src/lib/shared/tree-visualizer-host/tree-visualizer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devtools/projects/ng-devtools/src/lib/shared/tree-visualizer-host/tree-visualizer.ts b/devtools/projects/ng-devtools/src/lib/shared/tree-visualizer-host/tree-visualizer.ts index 26bf3a22e93..a40e2bde3d2 100644 --- a/devtools/projects/ng-devtools/src/lib/shared/tree-visualizer-host/tree-visualizer.ts +++ b/devtools/projects/ng-devtools/src/lib/shared/tree-visualizer-host/tree-visualizer.ts @@ -313,7 +313,7 @@ export class TreeVisualizer extends GraphRenderer const debouncer = new Debouncer(); const resizeObserver = new ResizeObserver( debouncer.debounce(([entry]) => { - if (!entry || !this.snappedNode) { + if (!entry || !entry.contentRect.width || !entry.contentRect.height || !this.snappedNode) { return; } // Avoid executing the code on observer init.