fix(h5): prioritize horizontal report image gestures

This commit is contained in:
xsl
2026-10-13 00:32:44 +08:00
parent 3efa28b311
commit 4c478b16e3
5 changed files with 15 additions and 14 deletions
+2 -2
View File
@@ -34,8 +34,8 @@ window.SwipeTrack = (function () {
if (!drag.horizontal) {
var threshold = options.startThreshold || 8, ratio = options.directionRatio || 1;
if (Math.max(Math.abs(dx), Math.abs(dy)) <= threshold) return;
// Ambiguous diagonal movement belongs to page scrolling. Once locked,
// neither direction can steal this gesture before the finger lifts.
// Each caller chooses its diagonal bias. Once locked, neither direction
// can steal this gesture before the finger lifts.
if (Math.abs(dy) * ratio >= Math.abs(dx)) { drag.vertical = true; return; }
drag.horizontal = true;
if (options.onStart) options.onStart(index);