Skip to content

Commit 811baa1

Browse files
Refactor tab click handling to use button check
1 parent 4df5d7e commit 811baa1

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎apps/web/src/components/RightPanelTabs.tsx‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import { COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS } from "~/workspaceTitlebar";
2424

2525
import { PreviewPanelShell, type PreviewPanelMode } from "./preview/PreviewPanelShell";
2626
import { PierreEntryIcon } from "./chat/PierreEntryIcon";
27-
import { shouldCloseRightPanelTabOnAuxClick } from "./RightPanelTabs.logic";
2827

2928
interface RightPanelTabsProps {
3029
mode: PreviewPanelMode;
@@ -333,12 +332,12 @@ export function RightPanelTabs(props: RightPanelTabsProps) {
333332
[props],
334333
);
335334
const handleTabMouseDown = useCallback((event: ReactMouseEvent) => {
336-
if (!shouldCloseRightPanelTabOnAuxClick(event.button)) return;
335+
if (event.button !== 1) return;
337336
event.preventDefault();
338337
}, []);
339338
const handleTabAuxClick = useCallback(
340339
(event: ReactMouseEvent, surface: RightPanelSurface) => {
341-
if (!shouldCloseRightPanelTabOnAuxClick(event.button)) return;
340+
if (event.button !== 1) return;
342341
event.preventDefault();
343342
event.stopPropagation();
344343
props.onCloseSurface(surface);

0 commit comments

Comments
 (0)