mirror of
https://github.com/documenso/documenso.git
synced 2025-11-10 04:22:32 +10:00
11 lines
276 B
TypeScript
11 lines
276 B
TypeScript
export const getBoundingClientRect = (element: HTMLElement) => {
|
|
const rect = element.getBoundingClientRect();
|
|
|
|
const { width, height } = rect;
|
|
|
|
const top = rect.top + window.scrollY;
|
|
const left = rect.left + window.scrollX;
|
|
|
|
return { top, left, width, height };
|
|
};
|