import TouchSensor from '@shopify/draggable/src/Draggable/Sensors/TouchSensor/TouchSensor.js'
TouchSensor
Extends:
This sensor picks up native browser touch events and dictates drag operations
Constructor Summary
Public Constructor | ||
public |
constructor(containers: HTMLElement[] | NodeList | HTMLElement, options: Object) TouchSensor constructor. |
Member Summary
Public Members | ||
public |
|
|
public |
currentScrollableParent: HTMLElement Closest scrollable container so accidental scroll can cancel long touch |
|
public |
dragging: * |
|
public |
|
|
public |
startEvent: * |
|
public |
TimeoutID for managing delay |
|
public |
touchMoved indicates if touch has moved during tapTimeout |
Private Members | ||
private |
pageX: * Save pageX coordinates for delay drag |
|
private |
pageY: * Save pageY coordinates for delay drag |
Method Summary
Public Methods | ||
public |
attach() Attaches sensors event listeners to the DOM |
|
public |
detach() Detaches sensors event listeners to the DOM |
Private Methods | ||
private |
[onDistanceChange](event: Event) Touch move handler prior to drag start. |
|
private |
[onTouchEnd](event: Event) Touch end handler |
|
private |
[onTouchMove](event: Event) Mouse move handler while dragging |
|
private |
[onTouchStart](event: Event) Touch start handler |
|
private |
Start the drag |
Public Constructors
Public Members
public currentContainer: * source
public currentScrollableParent: HTMLElement source
Closest scrollable container so accidental scroll can cancel long touch
Properties:
Name | Type | Attribute | Description |
currentScrollableParent | * |
public dragging: * source
public onTouchStartAt: * source
public startEvent: * source
public tapTimeout: Number source
TimeoutID for managing delay
Properties:
Name | Type | Attribute | Description |
tapTimeout | * |
public touchMoved: Boolean source
touchMoved indicates if touch has moved during tapTimeout
Properties:
Name | Type | Attribute | Description |
touchMoved | * |
Private Members
private pageX: * source
Save pageX coordinates for delay drag
Properties:
Name | Type | Attribute | Description |
pageX | Numbre |
private pageY: * source
Save pageY coordinates for delay drag
Properties:
Name | Type | Attribute | Description |
pageY | Numbre |
Public Methods
Private Methods
private [onDistanceChange](event: Event) source
Touch move handler prior to drag start.
Params:
Name | Type | Attribute | Description |
event | Event | Touch move event |
private [onTouchEnd](event: Event) source
Touch end handler
Params:
Name | Type | Attribute | Description |
event | Event | Touch end event |
private [onTouchMove](event: Event) source
Mouse move handler while dragging
Params:
Name | Type | Attribute | Description |
event | Event | Touch move event |
private [onTouchStart](event: Event) source
Touch start handler
Params:
Name | Type | Attribute | Description |
event | Event | Touch start event |