import Scrollable from '@shopify/draggable/src/Draggable/Plugins/Scrollable/Scrollable.js'Scrollable
Extends:
Scrollable plugin which scrolls the closest scrollable parent
Constructor Summary
| Public Constructor | ||
| public |
constructor(draggable: Draggable) Scrollable constructor. |
|
Member Summary
| Public Members | ||
| public |
Keeps current mouse position |
|
| public |
Animation frame looking for the closest scrollable element |
|
| public |
Scrollable options |
|
| public |
Scroll animation frame |
|
| public |
scrollableElement: HTMLElement | null Closest scrollable element |
|
Method Summary
| Public Methods | ||
| public |
attach() Attaches plugins event listeners |
|
| public |
detach() Detaches plugins event listeners |
|
| public |
getOptions(): Object Returns options passed through draggable |
|
| public |
getScrollableElement(target: HTMLElement): HTMLElement Returns closest scrollable elements by element |
|
| public |
hasDefinedScrollableElements(target: HTMLElement): Boolean Returns true if at least one scrollable element have been defined via options |
|
| Private Methods | ||
| private |
[onDragMove](dragEvent: DragMoveEvent) Drag move handler. |
|
| private |
[onDragStart](dragEvent: DragStartEvent) Drag start handler. |
|
| private |
Drag stop handler. |
|
| private |
[scroll]() Scroll function that does the heavylifting |
|
Public Constructors
Public Members
public findScrollableElementFrame: Number | null source
Animation frame looking for the closest scrollable element
Properties:
| Name | Type | Attribute | Description |
| findScrollableElementFrame | * |
Public Methods
public getScrollableElement(target: HTMLElement): HTMLElement source
Returns closest scrollable elements by element
Params:
| Name | Type | Attribute | Description |
| target | HTMLElement |
Return:
| HTMLElement |
public hasDefinedScrollableElements(target: HTMLElement): Boolean source
Returns true if at least one scrollable element have been defined via options
Params:
| Name | Type | Attribute | Description |
| target | HTMLElement |
Private Methods
private [onDragMove](dragEvent: DragMoveEvent) source
Drag move handler. Remembers mouse position and initiates scrolling
Params:
| Name | Type | Attribute | Description |
| dragEvent | DragMoveEvent |
private [onDragStart](dragEvent: DragStartEvent) source
Drag start handler. Finds closest scrollable parent in separate frame
Params:
| Name | Type | Attribute | Description |
| dragEvent | DragStartEvent |
