mirror of
https://github.com/documenso/documenso
synced 2026-04-21 21:37:18 +00:00
10 lines
276 B
TypeScript
10 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 };
|
|
};
|