| ... | ... | @@ -331,6 +331,19 @@ export function RightPanelTabs(props: RightPanelTabsProps) { |
| 331 | 331 | }, |
| 332 | 332 | [props], |
| 333 | 333 | ); |
| 334 | const handleTabMouseDown = useCallback((event: ReactMouseEvent) => { |
| 335 | if (event.button !== 1) return; |
| 336 | event.preventDefault(); |
| 337 | }, []); |
| 338 | const handleTabAuxClick = useCallback( |
| 339 | (event: ReactMouseEvent, surface: RightPanelSurface) => { |
| 340 | if (event.button !== 1) return; |
| 341 | event.preventDefault(); |
| 342 | event.stopPropagation(); |
| 343 | props.onCloseSurface(surface); |
| 344 | }, |
| 345 | [props], |
| 346 | ); |
| 334 | 347 | |
| 335 | 348 | useEffect(() => { |
| 336 | 349 | const activeTab = tabListRef.current?.querySelector<HTMLElement>("[data-active-tab='true']"); |
| ... | ... | @@ -367,6 +380,8 @@ export function RightPanelTabs(props: RightPanelTabsProps) { |
| 367 | 380 | <div |
| 368 | 381 | key={surface.id} |
| 369 | 382 | data-active-tab={active} |
| 383 | onMouseDown={handleTabMouseDown} |
| 384 | onAuxClick={(event) => handleTabAuxClick(event, surface)} |
| 370 | 385 | onContextMenu={(event) => void handleTabContextMenu(event, surface)} |
| 371 | 386 | className={cn( |
| 372 | 387 | "group flex h-7 min-w-25 max-w-44 shrink-0 items-center gap-1.5 rounded-md px-2 text-sm", |