@internal starts or continues auto-scroll when the dragged helper is clipped by the scroll container. * Takes the grid's own element to find the scroll container so external/sidebar drags work too (#2074).
(gridEl: HTMLElement)
| 430 | /** @internal starts or continues auto-scroll when the dragged helper is clipped by the scroll container. |
| 431 | * Takes the grid's own element to find the scroll container so external/sidebar drags work too (#2074). */ |
| 432 | public updateScrollPosition(gridEl: HTMLElement): void { |
| 433 | this._autoScrollContainer = Utils.getScrollElement(gridEl); // always use latest active grid |
| 434 | const clipping = this._getClipping(this.helper, this._autoScrollContainer); |
| 435 | if (clipping === 0) { |
| 436 | this._stopScrolling(); |
| 437 | } else if (!this._autoScrollAnimId) { |
| 438 | this._autoScrollAnimId = requestAnimationFrame(this._autoScrollTick); |
| 439 | } |
| 440 | } |
| 441 | |
| 442 | /** @internal compute how many pixels the element is clipped: negative = above, positive = below, 0 = fully inside OR outside (stop scrolling) */ |
| 443 | protected _getClipping(el: HTMLElement, scrollEl: HTMLElement): number { |
no test coverage detected