import MouseSensor from '@shopify/draggable/src/Draggable/Sensors/MouseSensor/MouseSensor.js'
MouseSensor
Extends:
This sensor picks up native browser mouse events and dictates drag operations
Constructor Summary
Public Constructor | ||
public |
constructor(containers: HTMLElement[] | NodeList | HTMLElement, options: Object) MouseSensor constructor. |
Member Summary
Public Members | ||
public |
|
|
public |
dragging: * |
|
public |
Mouse down timer which will end up triggering the drag start operation |
|
public |
|
|
public |
startEvent: * |
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 |
[onContextMenuWhileDragging](event: Event) Context menu handler |
|
private |
[onDistanceChange](event: Event) Detect change in distance, starting drag when both delay and distance requirements are met |
|
private |
[onMouseDown](event: Event) Mouse down handler |
|
private |
[onMouseMove](event: Event) Mouse move handler |
|
private |
[onMouseUp](event: Event) Mouse up handler |
|
private |
Start the drag |
Public Constructors
Public Members
public currentContainer: * source
public dragging: * source
public mouseDownTimeout: Number source
Mouse down timer which will end up triggering the drag start operation
Properties:
Name | Type | Attribute | Description |
mouseDownTimeout | * |
public onMouseDownAt: * source
public startEvent: * source
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 [onContextMenuWhileDragging](event: Event) source
Context menu handler
Params:
Name | Type | Attribute | Description |
event | Event | Context menu event |
private [onDistanceChange](event: Event) source
Detect change in distance, starting drag when both delay and distance requirements are met
Params:
Name | Type | Attribute | Description |
event | Event | Mouse move event |
private [onMouseDown](event: Event) source
Mouse down handler
Params:
Name | Type | Attribute | Description |
event | Event | Mouse down event |
private [onMouseMove](event: Event) source
Mouse move handler
Params:
Name | Type | Attribute | Description |
event | Event | Mouse move event |
private [onMouseUp](event: Event) source
Mouse up handler
Params:
Name | Type | Attribute | Description |
event | Event | Mouse up event |