mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
fix: reposition toggle sidebar button into view on window height reduce
This commit is contained in:
parent
edc8d32aac
commit
4f35c36054
1 changed files with 4 additions and 1 deletions
|
|
@ -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]) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue