fix: Resizing sidebars can also select text

This commit is contained in:
Tom Moor
2024-07-03 20:37:56 -04:00
parent 335957d914
commit 4e989e5c44
2 changed files with 3 additions and 1 deletions

View File

@@ -50,7 +50,8 @@ function Right({ children, border, className }: Props) {
}
}, []);
const handleMouseDown = React.useCallback(() => {
const handleMouseDown = React.useCallback((event) => {
event.preventDefault();
setResizing(true);
}, []);

View File

@@ -94,6 +94,7 @@ const Sidebar = React.forwardRef<HTMLDivElement, Props>(function _Sidebar(
const handleMouseDown = React.useCallback(
(event) => {
event.preventDefault();
setOffset(event.pageX - width);
setResizing(true);
setAnimating(false);