john-doherty / swiped-events

Adds `swiped` events to the DOM in 1k of pure JavaScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How can I prevent page reload or refresh

El-dorado01 opened this issue · comments

I tried using the swiped-down event listener but that doesn't seem to work.

Plus I wouldn't like to prevent the whole page from scrolling up.

document.addEventListener("swiped-down", (e) => { e.preventDefault(); console.log("Swiped down") //But this stops the page from scrolling back to the top })

That aside, is there a way to check for the swiped down event to prevent the page from reloading? @john-doherty