We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a73beef commit 16d9461Copy full SHA for 16d9461
src/hooks/useAlign.ts
@@ -199,6 +199,11 @@ export default function useAlign(
199
Math.round((eleRect.height / eleOutHeight) * 1000) / 1000,
200
);
201
202
+ // No need to align since it's not visible in view
203
+ if (scaleX === 0 || scaleY === 0) {
204
+ return;
205
+ }
206
+
207
const eleScrollWidth = (eleOutWidth - eleInnerWidth) * scaleX;
208
const eleScrollHeight = (eleOutHeight - eleInnerHeight) * scaleY;
209
const eleRight = eleRect.x + eleRect.width - eleScrollWidth;
0 commit comments