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 a38abfb commit 6eff8a8Copy full SHA for 6eff8a8
packages/transition/src/useFixedPositioning.ts
@@ -242,7 +242,7 @@ export function useFixedPositioning<
242
});
243
244
setStyle(style);
245
- setActive(!!element);
+ setActive(!!element && !element.hidden);
246
247
// Only changing the initialX and initialY should cause the useEffect below
248
// to trigger, which is why everything else is set in a ref.
@@ -274,8 +274,10 @@ export function useFixedPositioning<
274
275
276
useEffect(() => {
277
- updateStyle();
278
- }, [updateStyle]);
+ if (!ref.current || !ref.current.hidden) {
+ updateStyle();
279
+ }
280
+ }, [ref, updateStyle]);
281
282
const callbacks: Required<FixedPositioningTransitionCallbacks> = {
283
onEnter(appearing) {
0 commit comments