diegomura / diegomura/react-pdf

Setting padding in nested text elements has no effect

Open
#1,076 8 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
16.8k
Forks
1.3k
Avg merge
5h 6m
Merged PRs (30d)
52

Description

I want to make a component like [antd divider](https://ant.design/components/divider/), but setting the width and padding on the nested text has no effect. If want to leave a little space in the middle of the text and place a vertical dividing line, what do I need to do?

```jsx
const Demo = () => (


padding take effect
Not take effect some word


);

const styles = StyleSheet.create({
text: {
padding: '0 48pt',
},
});

ReactPDF.render();
```

![image](https://user-images.githubusercontent.com/7843281/101288670-ce900f80-3832-11eb-9073-57b0bf3e0a1d.png)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the supplied nested example with ReactPDF.render and compare it with the working top-level case. Trace how nested text layout handles width and padding. Done means the example produces the intended spacing, or the limitation and supported behavior are documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
react
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.