@fluentui/react-northstar
Version:
A themable React component library.
22 lines (21 loc) • 615 B
JavaScript
export function createReferenceFromClick(nativeEvent) {
var left = nativeEvent.clientX;
var top = nativeEvent.clientY;
var right = left + 1;
var bottom = top + 1;
function getBoundingClientRect() {
// @ts-expect-error - error exposed in TS 4.5 - caused by updated dom.lib.d.ts - missing the following properties from type 'ClientRect': x, y, toJSON
return {
left: left,
top: top,
right: right,
bottom: bottom,
height: 0,
width: 0
};
}
return {
getBoundingClientRect: getBoundingClientRect
};
}
//# sourceMappingURL=createReferenceFromClick.js.map