larger threshold for trackpad variability (#209674)

This commit is contained in:
Aaron Munger 2024-04-05 11:45:07 -07:00 committed by GitHub
parent 5edc703773
commit 235d4d104b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -587,14 +587,14 @@ async function webviewPreloads(ctx: PreloadContext) {
}
if (node.hasAttribute('recentlyScrolled')) {
if (lastTimeScrolled && Date.now() - lastTimeScrolled > 300) {
if (lastTimeScrolled && Date.now() - lastTimeScrolled > 400) {
// it has been a while since we actually scrolled
// if scroll velocity increases, it's likely a new scroll event
if (!!previousDelta && deltaY < 0 && deltaY < previousDelta - 2) {
// if scroll velocity increases significantly, it's likely a new scroll event
if (!!previousDelta && deltaY < 0 && deltaY < previousDelta - 8) {
clearTimeout(scrollTimeout);
scrolledElement?.removeAttribute('recentlyScrolled');
return false;
} else if (!!previousDelta && deltaY > 0 && deltaY > previousDelta + 2) {
} else if (!!previousDelta && deltaY > 0 && deltaY > previousDelta + 8) {
clearTimeout(scrollTimeout);
scrolledElement?.removeAttribute('recentlyScrolled');
return false;