Skip to content

Commit 2ecc0ce

Browse files
committed
chore: use rc-util isVisible func
1 parent 0bd8af1 commit 2ecc0ce

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/hooks/useAlign.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import isVisible from 'rc-util/lib/dom/isVisible';
12
import useEvent from 'rc-util/lib/hooks/useEvent';
23
import useLayoutEffect from 'rc-util/lib/hooks/useLayoutEffect';
34
import * as React from 'react';
@@ -229,7 +230,7 @@ export default function useAlign(
229230
if (
230231
scaleX === 0 ||
231232
scaleY === 0 ||
232-
(target instanceof HTMLElement && !target.offsetParent)
233+
(target instanceof HTMLElement && !isVisible(target))
233234
) {
234235
return;
235236
}

0 commit comments

Comments
 (0)