Long press hook
  • Introduction
  • Installation
  • Basics
  • Advanced
    • Definition
    • Callback
    • Options
      • Configuration
        • Events detection
        • Long press threshold
      • React events
        • Persisting event
        • Filtering events
      • Callbacks
        • Press started
        • On move
        • Press finished
        • Long press cancelled
      • Cancellation
        • Cancel outside element
        • Cancel on movement
    • Hook result / Bind function
      • Context
      • Handlers
  • Examples
    • Advanced usage example
    • Live examples
      • Version 3
      • Version 2 (deprecated)
      • Version 1 (deprecated)
  • Migration
    • V1 to V2
    • V2 to V3
    • ⚠️V3.1+
    • Change log
  • Contributions
    • ❤️Donations
    • Pull requests policy
  • Architectural Decisions
    • V1 and V2 deprecation
    • Moving to new repository
Powered by GitBook
On this page

Was this helpful?

  1. Advanced
  2. Options
  3. Cancellation

Cancel on movement

If long press should be cancelled when moved outside boundaries

PreviousCancel outside elementNextHook result / Bind function

Last updated 1 year ago

Was this helpful?

Name

cancelOnMovement

Type

boolean | number

Default value

false

Description

If long press should be canceled when mouse / touch / pointer move far enough from the initial press position.

Possible values:

  • false - Disable cancelling on movement

  • true - Enable cancelling on movement and use default 25px boundary size

  • number - Set a specific boundary value in pixels (square side size inside which movement won't cancel long press)