diff --git a/web/src/components/WikipediaBrowser.css b/web/src/components/WikipediaBrowser.css index baca317..8c1ee9a 100644 --- a/web/src/components/WikipediaBrowser.css +++ b/web/src/components/WikipediaBrowser.css @@ -71,4 +71,3 @@ max-width: 100%; height: auto; } - diff --git a/web/src/components/WikipediaBrowser.tsx b/web/src/components/WikipediaBrowser.tsx index c61f57a..c23dd0f 100644 --- a/web/src/components/WikipediaBrowser.tsx +++ b/web/src/components/WikipediaBrowser.tsx @@ -1,6 +1,6 @@ "use client"; -import React, { memo, useCallback, useEffect, useState, useRef } from "react"; +import React, { memo, useCallback, useEffect, useRef, useState } from "react"; import "./WikipediaBrowser.css"; interface Pane { @@ -47,9 +47,10 @@ const Resizer = memo(({ onResize }: { onResize: (delta: number) => void }) => { const startResizeX = useRef(0); const handleMouseDown = (e: React.MouseEvent) => { + e.preventDefault(); startResizeX.current = e.clientX; - document.addEventListener('mousemove', handleMouseMove); - document.addEventListener('mouseup', handleMouseUp); + document.addEventListener("mousemove", handleMouseMove); + document.addEventListener("mouseup", handleMouseUp); }; const handleMouseMove = (e: MouseEvent) => { @@ -59,13 +60,13 @@ const Resizer = memo(({ onResize }: { onResize: (delta: number) => void }) => { }; const handleMouseUp = () => { - document.removeEventListener('mousemove', handleMouseMove); - document.removeEventListener('mouseup', handleMouseUp); + document.removeEventListener("mousemove", handleMouseMove); + document.removeEventListener("mouseup", handleMouseUp); }; return (
); @@ -81,8 +82,8 @@ const PaneComponent = memo(({ pane, index, onClose, onClick, clickedLinks, onRes onResize: (index: number, delta: number) => void; }) => { return ( - <> -