mirror of
https://github.com/mathuo/dockview
synced 2025-11-25 08:52:17 +00:00
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:
parent
95c4ee1d26
commit
847f4f5219
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user