[DevTools] Update inspected element on component filter changes (#35599)

This commit is contained in:
Sebastian "Sebbie" Silbermann
2026-01-26 11:04:06 +01:00
committed by GitHub
parent a0566250b2
commit 2c30ebc4e3

View File

@@ -1086,6 +1086,15 @@ export default class Agent extends EventEmitter<{
}
renderer.updateComponentFilters(componentFilters);
}
// Due to the component filters changing, we might be able
// to select a closer match for the currently selected host element.
// The store will already select a suitable parent if the the current
// selection is now filtered out in which cases this will be a no-op.
const target = window.__REACT_DEVTOOLS_GLOBAL_HOOK__.$0;
if (target != null) {
this.selectNode(target);
}
};
getEnvironmentNames: () => void = () => {