MCPcopy Create free account
hub / github.com/szhsin/react-menu / getNormalizedClientRect

Function getNormalizedClientRect

src/positionUtils/getNormalizedClientRect.js:4–9  ·  view source on GitHub ↗
(element)

Source from the content-addressed store, hash-verified

2 Math.round(transformed) === untransformed ? transformed : untransformed;
3
4const getNormalizedClientRect = (element) => {
5 const rect = element.getBoundingClientRect();
6 rect.width = getNativeDimension(rect.width, element.offsetWidth);
7 rect.height = getNativeDimension(rect.height, element.offsetHeight);
8 return rect;
9};
10
11export { getNormalizedClientRect };

Callers 2

MenuGroup.jsFile · 0.90
getPositionHelpersFunction · 0.90

Calls 2

getNativeDimensionFunction · 0.85
getBoundingClientRectMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…