Skip to content

Commit 8ee51bd

Browse files
Switch tabs also when the click lands on the badge inside the tab
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
1 parent f0d57a7 commit 8ee51bd

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎client/src/webview/script.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,11 @@ export function getScript(vscode: VSCodeApi, document: Document, window: Window)
315315
return;
316316
}
317317

318-
// nav tab click
319-
if (target.classList.contains('nav-tab')) {
318+
// nav tab click (also on the badge inside the tab)
319+
const navTab = target.closest?.('.nav-tab');
320+
if (navTab) {
320321
e.stopPropagation();
321-
const tab = target.getAttribute('data-tab') as NavTab;
322+
const tab = navTab.getAttribute('data-tab') as NavTab;
322323
if (tab && tab !== selectedTab) {
323324
vscode.postMessage({ type: 'highlight', range: null });
324325
usage('tab', { tab });

0 commit comments

Comments
 (0)