diff --git a/packages/client/src/ui/universal.vue b/packages/client/src/ui/universal.vue index 3a7f76708f..4c38648ead 100644 --- a/packages/client/src/ui/universal.vue +++ b/packages/client/src/ui/universal.vue @@ -381,9 +381,12 @@ const onContextmenu = (ev: MouseEvent) => { }; const attachSticky = (el: any) => { - const sticky = new StickySidebar(widgetsEl); - addEventListener("scroll", () => { - sticky.calc(window.scrollY) + let lastScrollTop = 0; + addEventListener("scroll", (ev) => { + requestAnimationFrame(() => { + widgetsEl.scrollTop += window.scrollY - lastScrollTop; + lastScrollTop = window.scrollY <= 0 ? 0 : window.scrollY; + }) }, { passive: true }); }; @@ -557,8 +560,13 @@ console.log(mainRouter.currentRoute.value.name); } > .widgets-container { + position: sticky; + top: 0; + max-height: 100vh; + overflow-y: auto; padding: 0 var(--margin); width: 300px; + min-width: max-content; box-sizing: content-box; @media (max-width: $widgets-hide-threshold) { diff --git a/packages/client/src/ui/universal.widgets.vue b/packages/client/src/ui/universal.widgets.vue index 6e5f8df232..d931e1bf3f 100644 --- a/packages/client/src/ui/universal.widgets.vue +++ b/packages/client/src/ui/universal.widgets.vue @@ -84,7 +84,6 @@ function updateWidgets(widgets) {