fix: Enable close button functionality in tab overflow dropdown

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 <noreply@anthropic.com>
This commit is contained in:
mathuo 2025-07-31 21:45:26 +01:00
parent 95c4ee1d26
commit 847f4f5219
No known key found for this signature in database
GPG Key ID: C6EEDEFD6CA07281

View File

@ -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();