diff --git a/index.html b/index.html
index 30b4773..3df51d7 100644
--- a/index.html
+++ b/index.html
@@ -4247,26 +4247,42 @@
const now = Date.now();
const timeSinceLastTap = now - lastTapTime;
- // Check for double-tap (two taps within 300ms at roughly same location)
- if (timeSinceLastTap < 300 && lastTapLocation && pendingDestination) {
- // Double-tap detected - show navigation dialog
- e.preventDefault();
- e.stopPropagation();
-
- document.getElementById('pressHoldIndicator').style.display = 'none';
- const message = `Navigate to ${pendingDestination.track.name}?`;
- document.getElementById('navConfirmMessage').textContent = message;
- document.getElementById('navConfirmDialog').style.display = 'flex';
+ // Get current tap location
+ let currentTapLocation = null;
+ if (e.changedTouches && e.changedTouches.length > 0) {
+ const touch = e.changedTouches[0];
+ currentTapLocation = { x: touch.clientX, y: touch.clientY };
+ }
- lastTapTime = 0; // Reset to prevent triple tap
- lastTapLocation = null;
+ // Check for double-tap (two taps within 300ms at roughly same location)
+ if (timeSinceLastTap < 300 && lastTapLocation && currentTapLocation && pendingDestination) {
+ // Calculate distance between taps
+ const dx = currentTapLocation.x - lastTapLocation.x;
+ const dy = currentTapLocation.y - lastTapLocation.y;
+ const distance = Math.sqrt(dx * dx + dy * dy);
+
+ // Only trigger if taps are within 30 pixels of each other
+ if (distance < 30) {
+ // Double-tap detected at same location - show navigation dialog
+ e.preventDefault();
+ e.stopPropagation();
+
+ document.getElementById('pressHoldIndicator').style.display = 'none';
+ const message = `Navigate to ${pendingDestination.track.name}?`;
+ document.getElementById('navConfirmMessage').textContent = message;
+ document.getElementById('navConfirmDialog').style.display = 'flex';
+
+ lastTapTime = 0; // Reset to prevent triple tap
+ lastTapLocation = null;
+ } else {
+ // Taps too far apart - treat as new first tap
+ lastTapTime = now;
+ lastTapLocation = currentTapLocation;
+ }
} else {
// Store this tap for double-tap detection
lastTapTime = now;
- if (e.touches.length === 0 && e.changedTouches.length > 0) {
- const touch = e.changedTouches[0];
- lastTapLocation = { x: touch.clientX, y: touch.clientY };
- }
+ lastTapLocation = currentTapLocation;
}
if (isPressing) {