瀏覽代碼

fix(tui): ignore hidden tab close hitbox (#39940)

Kit Langton 2 周之前
父節點
當前提交
14e4c3dfd7
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      packages/tui/src/component/session-tabs.tsx

+ 3 - 0
packages/tui/src/component/session-tabs.tsx

@@ -341,6 +341,9 @@ export function SessionTabs(props: { controller?: SessionTabsController; animati
                   fg={closeColor()}
                   selectable={false}
                   onMouseUp={(event) => {
+                    // The close mark only renders while hovered; without motion events a click can
+                    // land here first, and must select the tab instead of closing it invisibly.
+                    if (hovered() !== tab.sessionID) return
                     event.stopPropagation()
                     tabs.close(tab === NEW_SESSION_TAB ? undefined : tab.sessionID)
                   }}