Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Bayheck committed May 7, 2024
1 parent 1d8fe9a commit effc5e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/client/utils/position.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export function getElementRectangle (el) {
rectangle = getSelectChildRectangle(el);
else {
const elementOffset = getOffsetPosition(el);
const relativeRectangle = domUtils.isSVGElementOrChild(el) ? getSvgElementRelativeRectangle(el) : el.getBoundingClientRect();
const relativeRectangle = domUtils.isSVGElementOrChild(el) ? getSvgElementRelativeRectangle(el) : el.getClientRects()[0];

rectangle = {
height: relativeRectangle.height,
Expand Down
4 changes: 2 additions & 2 deletions src/client/utils/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ export function getOffset (el) {
if (!el || domUtils.isWindow(el) || domUtils.isDocument(el))
return null;

let clientRect = el.getBoundingClientRect();
let clientRect = el.getClientRects()[0];

// NOTE: A detached node or documentElement.
const doc = el.ownerDocument;
Expand All @@ -338,7 +338,7 @@ export function getOffset (el) {
const scrollTop = win.pageYOffset || docElement.scrollTop || doc.body.scrollTop;
const scrollLeft = win.pageXOffset || docElement.scrollLeft || doc.body.scrollLeft;

clientRect = el.getBoundingClientRect();
clientRect = el.getClientRects()[0];

return {
top: clientRect.top + scrollTop - clientTop,
Expand Down

0 comments on commit effc5e7

Please sign in to comment.