nan check

This commit is contained in:
cupcakearmy 2021-02-08 11:24:03 +01:00
parent e08bf4e3ad
commit d1a3416577
No known key found for this signature in database
GPG Key ID: D28129AE5654D9D9

View File

@ -29,7 +29,7 @@
function updateScroll(e) {
const el = e.target
const percentage = el.scrollTop / (el.scrollHeight - el.offsetHeight)
scroll.set(percentage)
scroll.set(isNaN(percentage) ? 0 : percentage)
}
onMount(() => {