Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

πŸ› Fix duplicated number in stats badge text extraction (#3103)

Luke Vellac93e3d987ca8
diff --git a/apps/landing/src/components/home/animated-number.tsx b/apps/landing/src/components/home/animated-number.tsx
index e1929f3ca..b58608594 100644
--- a/apps/landing/src/components/home/animated-number.tsx
+++ b/apps/landing/src/components/home/animated-number.tsx
@@ -165,10 +165,15 @@ function AnimatedNumber({
className="relative inline-block tabular-nums"
>
{/* Invisible copy of the final number holds its width for the whole
- animation so the surrounding text doesn't shift as digits roll in */}
- <span className="invisible" aria-hidden="true">
- {sizerText}
- </span>
+ animation so the surrounding text doesn't shift as digits roll in.
+ Rendered as a pseudo-element rather than a text node so extractors
+ (search snippets, reader mode) don't see the number twice β€” the
+ readable copy is NumberFlow's own light-DOM text */}
+ <span
+ className="invisible before:content-[attr(data-value)]"
+ data-value={sizerText}
+ aria-hidden="true"
+ />
{/* NumberFlow's box is taller than the text (mask padding) but
symmetric around the glyphs, so centering it on the sizer β€” also
symmetric β€” puts both baselines in the same place */}