fix sidebar scroll algo

This commit is contained in:
Simon Vieille 2023-11-14 23:21:24 +01:00
parent 90603f62e0
commit 5d6531d197
Signed by: deblan
GPG key ID: 579388D585F70417

View file

@ -25,7 +25,7 @@ const Sidebar = () => {
if (currentItem) {
stickyMenu.scrollTo({
top: localStorage.getItem('sidebar-item-top') ?? 0,
top: Math.min(currentItem.offsetTop, localStorage.getItem('sidebar-item-top') ?? 0),
behavior: 'smooth'
})
}