From c9438380be090a2d2f25d91aa0aa6fe78f8f73c1 Mon Sep 17 00:00:00 2001 From: KoStard Date: Sat, 19 Feb 2022 17:08:29 +0100 Subject: [PATCH] Closing the tabs with middle mouse button --- src/PageTabs.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/PageTabs.tsx b/src/PageTabs.tsx index 6c8fbef..9f07298 100644 --- a/src/PageTabs.tsx +++ b/src/PageTabs.tsx @@ -81,6 +81,8 @@ const Tabs = React.forwardRef( data-dragging={draggingTab != null} className={`flex items-center h-full px-1`} style={{ width: "fit-content" }} + // By default middle button click will enter the horizontal scroll mode + onMouseDown={e => { if (e.button === 1) e.preventDefault(); }} > {tabs.map((tab) => { const isActive = isTabEqual(tab, activePage); @@ -108,6 +110,7 @@ const Tabs = React.forwardRef( return (
onClickTab(tab)} + onAuxClick={onClose} onDoubleClick={() => onPinTab(tab)} onContextMenu={(e) => { e.preventDefault();