Skip to content

PdfList (bullet): wrapped list items overlap vertically due to flex on Text inside flex column #103

@akii09

Description

@akii09

Bug Description

PdfList with variant="bullet" can render overlapping bullet rows when each item’s text wraps to multiple lines. Spacing between items (gap / marginBottom on the row) does not fix it; the row height is effectively too small for wrapped content.

  • apps/www/src/registry/components/list/list.styles.ts
    • itemText and itemTextSub set flex: 1 on text used across variants.
  • apps/www/src/registry/components/list/list.tsx
    • Bullet variant: body text is wrapped in <View style={{ flex: 1 }}> and uses styles.itemText on <Text>.
      So for bullets, Text gets flex: 1 while already inside a flex: 1 View, which matches a known @react-pdf/renderer / Yoga sharp edge: multi-line Text + flex can be measured with insufficient height, and the next row is laid out too high → visual overlap.

Steps to Reproduce

  1. Render a PdfList with variant="bullet".
  2. Use long strings so each bullet wraps to 2+ lines.
  3. Open the exported PDF — consecutive bullets overlap vertically.

Expected Behavior

Each bullet row’s height matches the full wrapped text; the following row starts below the previous block (plus normal row spacing).

Actual Behavior

Rows overlap; later lines draw on top of earlier bullet text.

Environment

  • @react-pdf/renderer: 4.x (e.g. 4.3.x)
  • Component: PdfList, variant="bullet"

Additional Context

Suggested direction (fix)

  • Do not apply flex: 1 on Text when it sits inside a flex: 1 View (bullet path).
  • Keep flex: 1 on Text only where it is a direct child of the horizontal row (numbered / checklist / icon / multi-level), e.g. via inline style on those PDFText nodes only, or split bullet vs inline text styles.

Notes

  • This is component/layout, not theme tokens: gap only adds marginBottom on the row in list.styles.ts.
  • Optional: link any related @react-pdf/renderer issues on Text + flex + wrapping if maintainers want to track engine-side behavior.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions