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
This commit is contained in:
hawkgs 2025-09-01 17:07:26 +03:00 committed by Miles Malerba
parent 66a2ae4cc0
commit 01bbafd47e

View file

@ -313,7 +313,7 @@ export class TreeVisualizer<T extends TreeNode = TreeNode> 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.