From 4c8cc5c016fcc6fa7c83423f1a0f36303eec6b45 Mon Sep 17 00:00:00 2001 From: Simo <153776287+SimoHypers@users.noreply.github.com> Date: Wed, 1 Jul 2026 20:59:00 +0400 Subject: [PATCH] fix: remove overflow hidden from safeTextStyle (#3186) overflow: hidden on Text elements in @react-pdf/renderer v4.x clips content at its initial computed height, hiding any text after a line break. minWidth/maxWidth/flexShrink already handle horizontal containment so nothing else breaks. Co-authored-by: Claude Sonnet 4.6 --- packages/pdf/src/templates/shared/safe-text-style.ts | 1 - packages/pdf/src/templates/shared/styles.ts | 4 ---- 2 files changed, 5 deletions(-) diff --git a/packages/pdf/src/templates/shared/safe-text-style.ts b/packages/pdf/src/templates/shared/safe-text-style.ts index 220d8ca9a..364118a6e 100644 --- a/packages/pdf/src/templates/shared/safe-text-style.ts +++ b/packages/pdf/src/templates/shared/safe-text-style.ts @@ -4,5 +4,4 @@ export const safeTextStyle = { minWidth: 0, maxWidth: "100%", flexShrink: 1, - overflow: "hidden", } satisfies Style; diff --git a/packages/pdf/src/templates/shared/styles.ts b/packages/pdf/src/templates/shared/styles.ts index 41d673746..4384619cf 100644 --- a/packages/pdf/src/templates/shared/styles.ts +++ b/packages/pdf/src/templates/shared/styles.ts @@ -31,10 +31,6 @@ export const mergeStyles = (...styles: StyleInput[]): Style => Object.assign({}, export const mergeLinkStyles = (options: LinkStyleOptions = {}, ...styles: StyleInput[]): Style => mergeStyles(...styles, resolveLinkDecorationStyle(options)); -// Increased from 1.2 to 1.3 to prevent descenders (g, p, y, etc.) from being -// clipped by the overflow:hidden applied in safeTextStyle on all Heading elements. -// At 1.5× heading font size, a lineHeight of 1.2 leaves insufficient room for -// the descender depth of many fonts, causing letters to appear visually cut off. export const headerNameLineHeight = 1.3; export type ResolvePlacementColorOptions = {