Skip to content

Commit

Permalink
Minor correction to scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
wstaeblein committed Mar 22, 2023
1 parent bb1cfca commit d6c88f1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion public/kineticscroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function kineticscroll(node, cfgs) {
node.addEventListener('mousedown', start);
node.addEventListener('mousemove', drag);
node.addEventListener('mouseup', release);
node.addEventListener('mouseleave', release);
node.addEventListener('mouseleave', preRelease);
if (configs.useWheel) { node.addEventListener('wheel', wheel); }

function getElementFullHeight(ele) {
Expand Down Expand Up @@ -149,6 +149,10 @@ export function kineticscroll(node, cfgs) {
return false;
}

function preRelease(e) {
if (e.buttons == 1) { release(e); }
}

function release(e) {
pressed = false;
wheeling = false;
Expand Down

0 comments on commit d6c88f1

Please sign in to comment.