Lazily resolves and returns the dimensions of the preview.
()
| 1598 | |
| 1599 | /** Lazily resolves and returns the dimensions of the preview. */ |
| 1600 | private _getPreviewRect(): DOMRect { |
| 1601 | // Cache the preview element rect if we haven't cached it already or if |
| 1602 | // we cached it too early before the element dimensions were computed. |
| 1603 | if (!this._previewRect || (!this._previewRect.width && !this._previewRect.height)) { |
| 1604 | this._previewRect = this._preview |
| 1605 | ? this._preview!.getBoundingClientRect() |
| 1606 | : this._initialDomRect!; |
| 1607 | } |
| 1608 | |
| 1609 | return this._previewRect; |
| 1610 | } |
| 1611 | |
| 1612 | /** Handles a native `dragstart` event. */ |
| 1613 | private _nativeDragStart = (event: DragEvent) => { |
no test coverage detected