This commit is contained in:
Freeplay 2023-06-10 18:33:39 -04:00
parent 2ec1e09105
commit 4bf7357c30

View file

@ -382,12 +382,16 @@ const onContextmenu = (ev: MouseEvent) => {
const attachSticky = (el: any) => {
let lastScrollTop = 0;
addEventListener("scroll", (ev) => {
requestAnimationFrame(() => {
widgetsEl.scrollTop += window.scrollY - lastScrollTop;
lastScrollTop = window.scrollY <= 0 ? 0 : window.scrollY;
})
}, { passive: true });
addEventListener(
"scroll",
(ev) => {
requestAnimationFrame(() => {
widgetsEl.scrollTop += window.scrollY - lastScrollTop;
lastScrollTop = window.scrollY <= 0 ? 0 : window.scrollY;
});
},
{ passive: true }
);
};
function top() {