From 847f4f5219ee41ec81dc00eddbe1a87445257bcc Mon Sep 17 00:00:00 2001 From: mathuo <6710312+mathuo@users.noreply.github.com> Date: Thu, 31 Jul 2025 21:45:26 +0100 Subject: [PATCH] fix: Enable close button functionality in tab overflow dropdown MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The close buttons in the tab dropdown were not working because the wrapper div's pointerdown event handler was intercepting all clicks. This fix checks if the click target is within a close button element (.dv-default-tab-action) and allows the close button's event handler to execute properly. Fixes #973 🤖 Generated with Claude Code (https://claude.ai/code) Co-Authored-By: Claude --- .../src/dockview/components/titlebar/tabsContainer.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/dockview-core/src/dockview/components/titlebar/tabsContainer.ts b/packages/dockview-core/src/dockview/components/titlebar/tabsContainer.ts index b96b13dd8..d803884a2 100644 --- a/packages/dockview-core/src/dockview/components/titlebar/tabsContainer.ts +++ b/packages/dockview-core/src/dockview/components/titlebar/tabsContainer.ts @@ -379,7 +379,16 @@ export class TabsContainer !panelObject.api.isActive ); - wrapper.addEventListener('pointerdown', () => { + wrapper.addEventListener('pointerdown', (event) => { + // Check if the click is on a close button or its children + const target = event.target as HTMLElement; + const isCloseButton = target.closest('.dv-default-tab-action') !== null; + + if (isCloseButton) { + // Let the close button handle its own event + return; + } + this.accessor.popupService.close(); tab.element.scrollIntoView(); tab.panel.api.setActive();