diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 0c2b351..cd106e6 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -3934,6 +3934,8 @@ function BracketViewport({ children }) { start.moved = true bracketPan.dragged = true el.classList.add('is-grabbing') + // Drop any text selection the initial press may have started. + window.getSelection()?.removeAllRanges() } if (start.moved) { el.scrollLeft = start.sl - dx @@ -3979,6 +3981,7 @@ function TournamentBracketSide({ side, navigate, highlight, onHover }) { // `tops` places each match; once placed we read back the DOM to draw connectors. const [layout, setLayout] = useState({ tops: new Map(), height: 0 }) const [connectors, setConnectors] = useState({ width: 0, height: 0, lines: [], byes: [] }) + const [collapsed, setCollapsed] = useState(false) // Pass 1: measure card heights, then position every match centred on its feeders. useLayoutEffect(() => { @@ -3994,7 +3997,7 @@ function TournamentBracketSide({ side, navigate, highlight, onHover }) { const observer = new ResizeObserver(relayout) observer.observe(grid) return () => observer.disconnect() - }, [side]) + }, [side, collapsed]) // Pass 2: with matches positioned, read real edges and draw elbow connectors. // Each connector carries the teams on either end so a hovered team's whole run @@ -4040,13 +4043,22 @@ function TournamentBracketSide({ side, navigate, highlight, onHover }) { } } setConnectors({ width: grid.scrollWidth, height: grid.scrollHeight, lines, byes }) - }, [side, layout]) + }, [side, layout, collapsed]) const active = Boolean(highlight) return ( -