MCPcopy
hub / github.com/hello-pangea/dnd / setBoundingClientRect

Function setBoundingClientRect

test/unit/view/use-draggable-publisher.spec.tsx:187–191  ·  view source on GitHub ↗
(element: Element | null, borderBox: Rect)

Source from the content-addressed store, hash-verified

185 // we are doing this rather than spying on the prototype.
186 // Sometimes setRef was being provided with an element that did not have the mocked prototype :|
187 const setBoundingClientRect = (element: Element | null, borderBox: Rect) => {
188 invariant(element);
189
190 element.getBoundingClientRect = () => setDOMRect(borderBox);
191 };
192
193 it('should publish the dimensions of the target when requested', () => {
194 const expected: DraggableDimension = getDraggableDimension({

Calls 2

invariantFunction · 0.90
setDOMRectFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…