From 4e989e5c445c58188f9ca396439175aa28114a5b Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Wed, 3 Jul 2024 20:37:56 -0400 Subject: [PATCH] fix: Resizing sidebars can also select text --- app/components/Sidebar/Right.tsx | 3 ++- app/components/Sidebar/Sidebar.tsx | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/components/Sidebar/Right.tsx b/app/components/Sidebar/Right.tsx index e0f6afaa3..3861a0ca0 100644 --- a/app/components/Sidebar/Right.tsx +++ b/app/components/Sidebar/Right.tsx @@ -50,7 +50,8 @@ function Right({ children, border, className }: Props) { } }, []); - const handleMouseDown = React.useCallback(() => { + const handleMouseDown = React.useCallback((event) => { + event.preventDefault(); setResizing(true); }, []); diff --git a/app/components/Sidebar/Sidebar.tsx b/app/components/Sidebar/Sidebar.tsx index a51e7cb90..d92039b06 100644 --- a/app/components/Sidebar/Sidebar.tsx +++ b/app/components/Sidebar/Sidebar.tsx @@ -94,6 +94,7 @@ const Sidebar = React.forwardRef(function _Sidebar( const handleMouseDown = React.useCallback( (event) => { + event.preventDefault(); setOffset(event.pageX - width); setResizing(true); setAnimating(false);