Skip to content

Commit

Permalink
fix: cut logic of measure (#437)
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ committed Nov 13, 2023
1 parent cf6ec04 commit 337ff4e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/hooks/useAlign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ export default function useAlign(
const originTop = popupElement.style.top;
const originRight = popupElement.style.right;
const originBottom = popupElement.style.bottom;
const originOverflow = popupElement.style.overflow;

// Placement
const placementInfo: AlignType = {
Expand All @@ -198,6 +199,7 @@ export default function useAlign(
popupElement.style.top = '0';
popupElement.style.right = 'auto';
popupElement.style.bottom = 'auto';
popupElement.style.overflow = 'hidden';

// Calculate align style, we should consider `transform` case
let targetRect: Rect;
Expand Down Expand Up @@ -281,6 +283,7 @@ export default function useAlign(
popupElement.style.top = originTop;
popupElement.style.right = originRight;
popupElement.style.bottom = originBottom;
popupElement.style.overflow = originOverflow;

popupElement.parentElement?.removeChild(placeholderElement);

Expand Down Expand Up @@ -672,6 +675,8 @@ export default function useAlign(
const offsetY4Bottom =
popupMirrorRect.bottom - popupRect.y - (nextOffsetY + popupRect.height);

debugger;

setOffsetInfo({
ready: true,
offsetX: nextOffsetX / scaleX,
Expand Down

0 comments on commit 337ff4e

Please sign in to comment.