import DragSensor from '@shopify/draggable/src/Draggable/Sensors/DragSensor/DragSensor.js'
DragSensor
Extends:
This sensor picks up native browser drag events and dictates drag operations
Constructor Summary
Public Constructor | ||
public |
constructor(containers: HTMLElement[] | NodeList | HTMLElement, options: Object) DragSensor constructor. |
Member Summary
Public Members | ||
public |
|
|
public |
draggableElement: HTMLElement Draggable element needs to be remembered to unset the draggable attribute after drag operation has completed |
|
public |
|
|
public |
Mouse down timer which will end up setting the draggable attribute, unless canceled |
|
public |
nativeDraggableElement: HTMLElement Native draggable element could be links or images, their draggable state will be disabled during drag operation |
|
public |
startEvent: * |
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 |
[onDragEnd](event: Event) Drag end handler |
|
private |
[onDragOver](event: Event) Drag over handler |
|
private |
[onDragStart](event: Event) Drag start handler |
|
private |
[onDrop](event: Event) Drop handler |
|
private |
[onMouseDown](event: Event) Mouse down handler |
|
private |
[onMouseUp](event: Event) Mouse up handler |
|
private |
[reset](event: Event) Mouse up handler |
Public Constructors
Public Members
public currentContainer: * source
public draggableElement: HTMLElement source
Draggable element needs to be remembered to unset the draggable attribute after drag operation has completed
Properties:
Name | Type | Attribute | Description |
draggableElement | * |
public mouseDownTimeout: Number source
Mouse down timer which will end up setting the draggable attribute, unless canceled
Properties:
Name | Type | Attribute | Description |
mouseDownTimeout | * |
public nativeDraggableElement: HTMLElement source
Native draggable element could be links or images, their draggable state will be disabled during drag operation
Properties:
Name | Type | Attribute | Description |
nativeDraggableElement | * |
public startEvent: * source
Public Methods
Private Methods
private [onDragEnd](event: Event) source
Drag end handler
Params:
Name | Type | Attribute | Description |
event | Event | Drag end event |
private [onDragOver](event: Event) source
Drag over handler
Params:
Name | Type | Attribute | Description |
event | Event | Drag over event |
private [onDragStart](event: Event) source
Drag start handler
Params:
Name | Type | Attribute | Description |
event | Event | Drag start event |
private [onDrop](event: Event) source
Drop handler
Params:
Name | Type | Attribute | Description |
event | Event | Drop event |
private [onMouseDown](event: Event) source
Mouse down handler
Params:
Name | Type | Attribute | Description |
event | Event | Mouse down event |
private [onMouseUp](event: Event) source
Mouse up handler
Params:
Name | Type | Attribute | Description |
event | Event | Mouse up event |
private [reset](event: Event) source
Mouse up handler
Params:
Name | Type | Attribute | Description |
event | Event | Mouse up event |