Skip to content

Commit ebbc36f

Browse files
committed
chore: fix scaleX pos
1 parent 2afa93e commit ebbc36f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/hooks/useAlign.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,6 @@ export default function useAlign(
199199
Math.round((eleRect.height / eleOutHeight) * 1000) / 1000,
200200
);
201201

202-
// No need to align since it's not visible in view
203-
if (scaleX === 0 || scaleY === 0) {
204-
return;
205-
}
206-
207202
const eleScrollWidth = (eleOutWidth - eleInnerWidth) * scaleX;
208203
const eleScrollHeight = (eleOutHeight - eleInnerHeight) * scaleY;
209204
const eleRight = eleRect.x + eleRect.width - eleScrollWidth;
@@ -227,6 +222,11 @@ export default function useAlign(
227222
Math.round((popupHeight / parseFloat(height)) * 1000) / 1000,
228223
);
229224

225+
// No need to align since it's not visible in view
226+
if (scaleX === 0 || scaleY === 0) {
227+
return;
228+
}
229+
230230
// Offset
231231
const { offset, targetOffset } = placementInfo;
232232
const [popupOffsetX = 0, popupOffsetY = 0] = offset || [];

0 commit comments

Comments
 (0)