fix: confetti animation display issue (#6085)

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Victor Santos <victor@formbricks.com>
This commit is contained in:
Matti Nannt
2025-06-26 08:35:19 +02:00
committed by GitHub
parent ed3c2d2b58
commit ce8f9de8ec
3 changed files with 23 additions and 3 deletions

View File

@@ -356,7 +356,7 @@
"start_free_trial": "Iniciar Teste Grátis",
"status": "status",
"step_by_step_manual": "Manual passo a passo",
"styling": "estilização",
"styling": "Estilização",
"submit": "Enviar",
"summary": "Resumo",
"survey": "Pesquisa",
@@ -368,7 +368,7 @@
"survey_paused": "Pesquisa pausada.",
"survey_scheduled": "Pesquisa agendada.",
"survey_type": "Tipo de Pesquisa",
"surveys": "pesquisas",
"surveys": "Pesquisas",
"switch_organization": "Mudar organização",
"switch_to": "Mudar para {environment}",
"table_items_deleted_successfully": "{type}s deletados com sucesso",

View File

@@ -12,6 +12,7 @@ vi.mock("react-confetti", () => ({
data-colors={JSON.stringify(props.colors)}
data-number-of-pieces={props.numberOfPieces}
data-recycle={props.recycle}
style={props.style}
/>
)),
}));
@@ -36,6 +37,10 @@ describe("Confetti", () => {
expect(confettiElement).toHaveAttribute("data-colors", JSON.stringify(["#00C4B8", "#eee"]));
expect(confettiElement).toHaveAttribute("data-number-of-pieces", "400");
expect(confettiElement).toHaveAttribute("data-recycle", "false");
expect(confettiElement).toHaveAttribute(
"style",
"position: fixed; top: 0px; left: 0px; z-index: 9999; pointer-events: none;"
);
});
test("renders with custom colors", () => {

View File

@@ -13,5 +13,20 @@ export const Confetti: React.FC<ConfettiProps> = ({
colors?: string[];
}) => {
const { width, height } = useWindowSize();
return <ReactConfetti width={width} height={height} colors={colors} numberOfPieces={400} recycle={false} />;
return (
<ReactConfetti
width={width}
height={height}
colors={colors}
numberOfPieces={400}
recycle={false}
style={{
position: "fixed",
top: 0,
left: 0,
zIndex: 9999,
pointerEvents: "none",
}}
/>
);
};