Skip to content

Commit c5ca597

Browse files
hawkgskirjs
authored andcommitted
refactor(devtools): switch to components tab whenever the inspector is used (angular#60694)
Switch to the components tab, if not there, when a component is selected via the inspector. PR Close angular#60694
1 parent 7c1a16d commit c5ca597

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

devtools/projects/ng-devtools/src/lib/devtools-tabs/devtools-tabs.component.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@ export class DevToolsTabsComponent {
9595
this.routes.set(routes || []);
9696
});
9797

98+
// Change the tab to Components, if an element is selected via the inspector.
99+
this._messageBus.on('selectComponent', () => {
100+
if (this.activeTab() !== 'Components') {
101+
this.changeTab('Components');
102+
}
103+
});
104+
98105
if (typeof chrome !== 'undefined' && chrome.runtime !== undefined) {
99106
this.extensionVersion.set(chrome.runtime.getManifest().version);
100107
}

0 commit comments

Comments
 (0)