Fixed the scroll issue

- fixed the scroll issue that was causing the scroll being possible on elements that it shouldn't
This commit is contained in:
Makhuta
2026-02-07 00:03:11 +01:00
parent b566d25637
commit eb3d4be4d1
3 changed files with 33 additions and 1 deletions
@@ -62,6 +62,10 @@
padding: 0;
}
[data-melt-toaster-root]:empty {
display: none;
}
[data-melt-toaster-toast-content]:nth-last-child(n + 4) {
z-index: 1;
scale: 0.925;
+16 -1
View File
@@ -4,6 +4,7 @@
:root {
--video-player-height: 0px;
--safe-area-inset-top: 0px;
}
@font-face {
@@ -11,6 +12,19 @@
src: url('/inter.ttf');
}
html,
body {
height: 100%;
margin: 0;
overflow: hidden;
}
:has(>main) {
height: 100%;
min-height: 0;
overflow: hidden;
}
.hide {
display: none;
}
@@ -58,9 +72,10 @@ dialog {
}
main.root {
max-height: 100vh;
min-height: 0;
overflow-y: auto;
overflow-x: hidden;
overscroll-behavior: contain;
}
.row {
@@ -61,8 +61,13 @@
page.subscribe((pageData) => {
playerIsPip = !pageData.url.pathname.includes('/watch');
requestAnimationFrame(() => resetScroll());
});
playerState.subscribe((player) => {
requestAnimationFrame(() => resetScroll());
})
interfaceAmoledTheme.subscribe(async () => {
setAmoledTheme();
@@ -194,6 +199,13 @@
await ui('theme', hex);
});
function resetScroll() {
const main = document.querySelector('main.root');
if (main) main.scrollTop = 0;
document.documentElement.scrollTop = 0;
document.body.scrollTop = 0;
}
onMount(async () => {
ui();
@@ -233,6 +245,7 @@
if (isLoggedIn) {
loadNotifications().catch(() => authStore.set(null));
}
resetScroll();
});
let webManifestLink = $derived(pwaInfo ? pwaInfo.webManifest.linkTag : '');