Skip to content

Commit 337ff4e

Browse files
authored
fix: cut logic of measure (#437)
1 parent cf6ec04 commit 337ff4e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/hooks/useAlign.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ export default function useAlign(
177177
const originTop = popupElement.style.top;
178178
const originRight = popupElement.style.right;
179179
const originBottom = popupElement.style.bottom;
180+
const originOverflow = popupElement.style.overflow;
180181

181182
// Placement
182183
const placementInfo: AlignType = {
@@ -198,6 +199,7 @@ export default function useAlign(
198199
popupElement.style.top = '0';
199200
popupElement.style.right = 'auto';
200201
popupElement.style.bottom = 'auto';
202+
popupElement.style.overflow = 'hidden';
201203

202204
// Calculate align style, we should consider `transform` case
203205
let targetRect: Rect;
@@ -281,6 +283,7 @@ export default function useAlign(
281283
popupElement.style.top = originTop;
282284
popupElement.style.right = originRight;
283285
popupElement.style.bottom = originBottom;
286+
popupElement.style.overflow = originOverflow;
284287

285288
popupElement.parentElement?.removeChild(placeholderElement);
286289

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

678+
debugger;
679+
675680
setOffsetInfo({
676681
ready: true,
677682
offsetX: nextOffsetX / scaleX,

0 commit comments

Comments
 (0)