MCPcopy Create free account
hub / github.com/angular/components / _getPreviewRect

Method _getPreviewRect

src/cdk/drag-drop/drag-ref.ts:1600–1610  ·  view source on GitHub ↗

Lazily resolves and returns the dimensions of the preview.

()

Source from the content-addressed store, hash-verified

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) => {

Callers 1

Calls 1

getBoundingClientRectMethod · 0.80

Tested by

no test coverage detected