diff --git a/src/components/ToggleShowButton.tsx b/src/components/ToggleShowButton.tsx index fcd929e..c1ccf0b 100644 --- a/src/components/ToggleShowButton.tsx +++ b/src/components/ToggleShowButton.tsx @@ -37,11 +37,14 @@ export function ToggleShowButton({ error, className, onClick, onHover }: Props) [distance], ) + // reposition on window height change, but ignores distance change React.useEffect(() => { if (ref.current) { ref.current.style.top = distance + 'px' } - }, []) + }, [height]) + + // And this repositions on drag const { onPointerDown } = useResizeHandler( [distance, distance], ([, y]) => {