# On move

#### Name

`onMove`

#### Type

{% code title="Javascript" %}

```javascript
(event, meta) => void
```

{% endcode %}

{% code title="TypeScript" %}

```typescript
(
  event: 
  | ReactMouseEvent<Target>
  | ReactTouchEvent<Target>
  | ReactPointerEvent<Target>,
  meta: { context?: Context; reason?: LongPressCallbackReason }
) => void
```

{% endcode %}

#### Default value

`undefined`

#### Description

Called when moving over element. Because long press [binder](/long-press-hook/advanced/hook-result-bind-function.md) will overwrite any movement handler, this callback is called when ANY movement occur (not necessarily after press). This way you can still call your regular movement handler using this callback.

All processing will happen only if element is pressed and [cancelOnMovement](/long-press-hook/advanced/options/cancellation/cancel-on-movement.md) option is enabled.

Since current position is extracted from event after this callback is called, you can potentially manipulate event position to model more complex behaviours.\
\
Position is extracted as follows:

```typescript
 // Touch event
 return {
  x: event.touches[0].pageX,
  y: event.touches[0].pageY,
 }
 
 // Mouse and pointer events
 return {
  x: event.pageX,
  y: event.pageY,
 }
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://minwork.gitbook.io/long-press-hook/advanced/options/callbacks/on-move.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
