mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-23 01:50:13 +08:00
feat: add middle-click tab closing (#10498)
This commit is contained in:
parent
e7e5c0456f
commit
b7e7174f3d
@ -237,7 +237,17 @@ const TabsContainer: React.FC<TabsContainerProps> = ({ children }) => {
|
||||
onSortEnd={onSortEnd}
|
||||
className="tabs-sortable"
|
||||
renderItem={(tab) => (
|
||||
<Tab key={tab.id} active={tab.id === activeTabId} onClick={() => handleTabClick(tab)}>
|
||||
<Tab
|
||||
key={tab.id}
|
||||
active={tab.id === activeTabId}
|
||||
onClick={() => handleTabClick(tab)}
|
||||
onAuxClick={(e) => {
|
||||
if (e.button === 1 && tab.id !== 'home') {
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
closeTab(tab.id)
|
||||
}
|
||||
}}>
|
||||
<TabHeader>
|
||||
{tab.id && <TabIcon>{getTabIcon(tab.id, minapps, minAppsCache)}</TabIcon>}
|
||||
<TabTitle>{getTabTitle(tab.id)}</TabTitle>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user