diegomura / diegomura/react-pdf

Implement textOverflow: "clip"

Open
#1,753 0 comments 0 reactions 0 assignees View on GitHub
new feature
Dominant language
TypeScript
Stars
16.8k
Forks
1.3k
Avg merge
5h 6m
Merged PRs (30d)
52

Description

**Is your feature request related to a problem? Please describe.**
I want to remove the ellipsis when text is being overflowed and show as much text as possible.

**Describe the solution you'd like**
Implement `textOverflow: "clip"`.

**Describe alternatives you've considered**
I have considered restricting the maximum text length, but then I would need to consider how not all glyphs are the same width.

**Additional context**
![image](https://user-images.githubusercontent.com/46385475/159390506-91076606-ecca-4f49-98e9-d534622bc5f1.png)
There is plenty of space to show more text, but it seems to start the ellipsis before starting the second word.

Here is some example code:
```tsx
import { Font, View, Text } from '@react-pdf/renderer'

// Remove hyphenation
Font.registerHyphenationCallback(word => [word]);

const Component = () => (


{`Roberto Superlonglastname`.toUpperCase()}


)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.