@uiw/react-overlay-trigger
Version:
OverlayTrigger component
15 lines (14 loc) • 381 B
text/typescript
/**
* Given element offsets, generate an output similar to getBoundingClientRect
* @method
* @memberof Popper.Utils
* @argument {Object} offsets
* @returns {Object} ClientRect like output
*/
export default function getClientRect(offsets: DOMRect): DOMRect {
return {
...offsets,
right: offsets.left + offsets.width,
bottom: offsets.top + offsets.height,
};
}