Skip to main content

Pinch event

Pinch values

PropertydefaultDescription
deviceType of device
activefalseWhether drag is active.
_activefalseWhether 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
targetnullTarget element

Pinch events

Event nameArgumentDescription
pinchPinchStateCalled on all pinch events. Mainly events specified
pinchStartEvenrtCalled on pinch start event.
pinchingEventCalled on every pinch event.
pinchEndEventCalled on pinch end event.
mountElementCalled when the component is mounted
cleannullCalled 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
pinch: (self: PinchState) => void
pinchStart(e: Event): void
pinching(e: Event): void
pinchEnd(e: Event): void
mount(target: El): void
clean(target?: El): void
ref(target: El | null): void
}