Pinch event
Pinch values
Property | default | Description |
---|---|---|
device | Type of device | |
active | false | Whether drag is active. |
_active | false | Whether drag is active. |
value | [0, 0] | Current position |
_value | [0, 0] | Previous position |
delta | [0, 0] | Delta of position |
offset | [0, 0] | Offset of position |
movement | [0, 0] | Movement of position |
target | null | Target element |
Pinch events
Event name | Argument | Description |
---|---|---|
onPinch | PinchState | Called on all pinch events. Mainly events specified |
onPinchStart | Evenrt | Called on pinch start event. |
onPinching | Event | Called on every pinch event. |
onPinchEnd | Event | Called on pinch end event. |
onMount | Element | Called when the component is mounted |
onClean | null | Called when the component is removed |
Pinch state
export type Vec2 = [x: number, y: number]
export interface PinchState<El extends Element = Element> {
_active: boolean
active: boolean
device: 'mouse' | 'pointer' | 'touch'
_value: Vec2
value: Vec2
delta: Vec2
offset: Vec2
movement: Vec2
event: Event
target: El
isPinchStart: boolean
isPinching: boolean
isPinchEnd: boolean
onPinch: (self: PinchState) => void
onPinchStart(e: Event): void
onPinching(e: Event): void
onPinchEnd(e: Event): void
onMount(target: El): void
onClean(target?: El): void
ref(target: El | null): void
}