Skip to content

fix(core): arm doubleClickDragZoom by coordinating the dblclickdrag recognizer#10418

Merged
charlieforward9 merged 1 commit into
x/mjolnir-upfrom
fix/doubleclickdrag-recognizer
Jul 3, 2026
Merged

fix(core): arm doubleClickDragZoom by coordinating the dblclickdrag recognizer#10418
charlieforward9 merged 1 commit into
x/mjolnir-upfrom
fix/doubleclickdrag-recognizer

Conversation

@charlieforward9

Copy link
Copy Markdown
Member

Problem

doubleClickDragZoom (added in #10327, enabled by the mjolnir.js 3.0.1 upgrade in this PR) never fires — a double-click-drag silently pans instead of zooming.

Cause

dblclickdrag was registered in RECOGNIZERS with no recognizeWith relationship. mjolnir's manager calls reset() on any non-active recognizer that can't recognize-with the currently active one. So the moment click/dblclick activate during the first tap, DoubleClickDrag's cross-tap memory (_lastTap) is wiped before the pointer-up is even processed. The second press then never matches a prior tap, the gesture never arms, and the drag falls through to pan.

Fix

Register dblclickdrag to recognize simultaneously with click/dblclick. Its tap memory survives the first tap; it then becomes the active recognizer on the second press, which also suppresses the competing pan (no zoom+pan jitter).

Verification (headless pointer input)

  • Double-click-drag up → zooms 4.0 → 5.2, latitude drifts only monotonically (anchored-zoom pivot), no pan sawtooth.
  • Plain drag → still pans (lng changes, zoom unchanged).
  • Plain double-click → still zooms in one step.

cc @Pessimistress

🤖 Generated with Claude Code

…blclick

The DoubleClickDrag recognizer was registered with no recognizeWith
relationship, so mjolnir's manager called reset() on it as soon as the
click/dblclick recognizers activated during the first tap. That wiped its
cross-tap memory (_lastTap) before the pointer-up was processed, so the
second press never matched a prior tap and the gesture never armed --
doubleClickDragZoom silently fell through to pan.

Registering it to recognize simultaneously with click/dblclick keeps its
tap memory intact; it then becomes the active recognizer on the second
press, which also suppresses the competing pan (no more zoom+pan jitter).

Verified end-to-end via headless input: double-click-drag now zooms with
no pan drift, while plain drag still pans and plain double-click still
zooms one step.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@charlieforward9 charlieforward9 force-pushed the fix/doubleclickdrag-recognizer branch from 2453242 to bd9a266 Compare July 3, 2026 19:34
@charlieforward9 charlieforward9 merged commit afeb3d8 into x/mjolnir-up Jul 3, 2026
3 checks passed
@charlieforward9 charlieforward9 deleted the fix/doubleclickdrag-recognizer branch July 3, 2026 19:35
@charlieforward9 charlieforward9 self-assigned this Jul 3, 2026
@coveralls

coveralls commented Jul 3, 2026

Copy link
Copy Markdown

Coverage Status

Coverage is 83.136%fix/doubleclickdrag-recognizer into x/mjolnir-up. No base build found for x/mjolnir-up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants