mirror of
https://github.com/cupcakearmy/nicco.io.git
synced 2024-12-22 08:06:29 +00:00
nan check
This commit is contained in:
parent
e08bf4e3ad
commit
d1a3416577
@ -29,7 +29,7 @@
|
|||||||
function updateScroll(e) {
|
function updateScroll(e) {
|
||||||
const el = e.target
|
const el = e.target
|
||||||
const percentage = el.scrollTop / (el.scrollHeight - el.offsetHeight)
|
const percentage = el.scrollTop / (el.scrollHeight - el.offsetHeight)
|
||||||
scroll.set(percentage)
|
scroll.set(isNaN(percentage) ? 0 : percentage)
|
||||||
}
|
}
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user