npm hammerjs 2.1.0-rc.4
v2.1.0-rc.4

45 minutes ago
Recognizers
  • Return clean terminal STATE_ENDED and STATE_CANCELLED states in AttrRecognizer without leaking STATE_BEGAN / STATE_CHANGED bits
  • Immediately cancel armed _requiredBy dependents when a required recognizer commits in Recognizer.requireFailure()
  • Preserve terminal STATE_RECOGNIZED when a committing recognizer disables itself inside its own handler
Input
  • Compute distance and angle consistently from rebased (deltaX, deltaY) across single- and multi-touch transitions (fixes 3→2 finger liftoff jumps)
  • Unify non-touch release checks in PointerEventInput to !(ev.buttons & 1), fixing stylus tip lift while holding a barrel button (buttons === 2)
  • Drop redundant single-touch hasParent() check in TouchInput (also fixes single-touch on slotted light-DOM children inside closed Shadow DOM)
  • Treat sourceCapabilities.firesTouchEvents as authoritative when present in TouchMouseInput so explicit firesTouchEvents: false mouse clicks are not suppressed for 2.5s
  • Self-heal stale started state in SingleTouchInput on unrelated fresh touchstart (stopping the abandoned session), clear stale session.prevInput on fresh target starts, and compute isFirst cleanly when another finger rests outside the target
  • Wrap hammer.input emits inside try ... finally in inputHandler() so session.prevInput stays consistent if a listener throws
Manager & Touch-action
  • Exempt 2-finger pinch-zoom in the JS TouchAction polyfill for compound pan-x pinch-zoom / pan-y pinch-zoom (e.g. new Hammer(document) / new Hammer(window))
  • Preserve Hammer.defaults.preset.concat(...) preset-override compatibility during Manager construction and make Manager.destroy() idempotent
Internal Simplification
  • Remove unused internal helpers (ifUndefined, inStr, inArray, toArray, uniqueArray, simpleCloneInputData, hasSamePrimaryPointerPair, canContinueEmit, updateInputListeners, getTouchActionProps), redundant state flags (PressRecognizer._recognized, TouchMouseInput._touchActive), and unreachable/test-only guards (net −250 lines in src/)

Full Changelog: v2.1.0-rc.3...v2.1.0-rc.4

Don't miss a new hammerjs release

NewReleases is sending notifications on new releases.