Skip to content

Commit c9cb1b4

Browse files
committed
fix: resolve overlay for both overlay and fullScreenOverlay
1 parent 3e5be2d commit c9cb1b4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/src/react/particles/particles.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,18 @@ export const Particles = ({ options, overlay, fullScreenOverlay, ...props }: Par
2424
? { position: "fixed", top: 0, left: 0, width: "100vw", height: "100vh" }
2525
: {};
2626

27+
const resolvedOverlay = overlay || fullScreenOverlay;
28+
2729
const style = (
28-
overlay ? { pointerEvents: "none", ...fsStyles, ...props.style } : props.style
30+
resolvedOverlay ? { pointerEvents: "none", ...fsStyles, ...props.style } : props.style
2931
) as CSSProperties;
3032

3133
useEffect(
3234
() =>
33-
canvasRef.current ? renderParticles(canvasRef.current, { ...options, overlay }) : undefined,
34-
[options, overlay],
35+
canvasRef.current
36+
? renderParticles(canvasRef.current, { ...options, overlay: resolvedOverlay })
37+
: undefined,
38+
[options, resolvedOverlay],
3539
);
3640
return <canvas ref={canvasRef} style={style} {...props} data-testid="particles" />;
3741
};

0 commit comments

Comments
 (0)