fix sidebar scroll algo
This commit is contained in:
parent
90603f62e0
commit
5d6531d197
|
@ -25,7 +25,7 @@ const Sidebar = () => {
|
||||||
|
|
||||||
if (currentItem) {
|
if (currentItem) {
|
||||||
stickyMenu.scrollTo({
|
stickyMenu.scrollTo({
|
||||||
top: localStorage.getItem('sidebar-item-top') ?? 0,
|
top: Math.min(currentItem.offsetTop, localStorage.getItem('sidebar-item-top') ?? 0),
|
||||||
behavior: 'smooth'
|
behavior: 'smooth'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue