1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-30 10:36:35 +02:00

Desktop: Fixes #9629: Fix horizontal touchpad scrolling of code blocks (#9815)

This commit is contained in:
Henry Heino 2024-02-02 10:50:56 -08:00 committed by GitHub
parent b51e16c255
commit 2d4fc08f2b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -594,12 +594,20 @@
// calculate by yourself by accumulating wheel events.
// https://github.com/laurent22/joplin/pull/5496
// When the Electron/Chromium bug is fixed, remove this listener.
//
// 2024-02-01: The bug seems to be fixed, remove the above when we're not in
// feature-freeze.
// If scrollTop ever has a fraction part, zoomFactor is not 1.
if (zoomFactorIsNotOne || !Number.isInteger(contentElement.scrollTop)) {
zoomFactorIsNotOne = true;
customScroll(e, true);
e.preventDefault();
// The custom scroll logic breaks horizontal scroll in child DOM nodes
// (e.g. scrollable code blocks). Disable it:
if (e.deltaY !== 0) {
customScroll(e, true);
e.preventDefault();
}
}
}));