gap property not working correctly with flexDirection: "column" in Text elements with flexWrap
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- react, typescript
- Domain
- frontend
Research direction
Start by reproducing the supplied RowLabelValue and HeaderCliente components with wrapped Text elements and column flexDirection. Then trace the flex layout and gap handling for wrapped Text children; done means vertically stacked rows retain consistent spacing without collapsing or overlapping.
Written by the indexing model from the issue text.
Description
When using flexbox layout with flexDirection: "column" and gap property to space multiple rows containing wrapped Text elements, the gap is not applied correctly. This causes child elements to collapse and overlap on the same line instead of being properly separated vertically.
The gap property should create consistent vertical spacing between each row, regardless of the Text content length or wrapping.
import { Text, View } from "@react-pdf/renderer";
import fontSizes from "../../styles/fontSizes";
interface RowLabelValueProps {
label: string;
value: string | number;
labelWidth?: number;
marginBottom?:number;
}
export const RowLabelValue = ({
label,
value,
labelWidth = 110,
marginBottom = 5,
}: RowLabelValueProps) => {
return (
<View
style={{
flexDirection: "row",
width: "100%",
minHeight: 12,
alignItems: "flex-start",
marginBottom,
}}
>
<Text
style={[
fontSizes.bold,
fontSizes.normal,
{ width: labelWidth, flexShrink: 0, textAlign: "left" },
]}
>
{label}
</Text>
<Text
style={[
fontSizes.value,
fontSizes.normal,
{ flex: 1, textAlign: "left", flexWrap: "wrap" },
]}
>
{value}
</Text>
</View>
);
};
import { View } from "@react-pdf/renderer";
import { Cliente } from "../../../models/general";
import { RowLabelValue } from "../../common/RowLabelValue";
export const HeaderCliente = ({ cliente }: { cliente: Cliente }) => (
<View style={{ flexDirection: 'row', justifyContent: 'space-between', width: '100%', gap: 8 }}>
<View style={{ flexDirection: 'column', justifyContent: 'flex-start', width: '60%', gap: 10 }}>
<RowLabelValue label="Señores: " value={cliente.razonSocial} />
<RowLabelValue label="Dirección: " value={cliente.direccion} />
<RowLabelValue label="CUIT: " value={cliente.cuit} />
</View>
<View style={{ flexDirection: 'column', justifyContent: 'flex-start', width: '40%', gap: 10 }}>
<RowLabelValue label="Tel: " value={cliente.telefono} />
<RowLabelValue label="Localidad: " value={cliente.localidad} />
<RowLabelValue label="I.V.A: " value={cliente.iva} />
</View>
</View>
);
export default HeaderCliente;
- Dominant language
- TypeScript
- Stars
- 16.9k
- Forks
- 1.3k
- Avg merge
- 11m
- Merged PRs (30d)
- 2
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from diegomura/react-pdf
-
@react-pdf/font: published types import fontkit, but @types/fontkit is only a devDependencyPossibly taken @iliev-blnk claimed this 15 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Unable to set flexShrink to 0Possibly taken @adarshsm claimed this 14 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
@react-pdf/hyphenate: import-only exports map throws ERR_PACKAGE_PATH_NOT_EXPORTED in require-condition resolvers (every tsx script loading renderer >= 4.7 crashes)Possibly taken @cruzdanilo claimed this 43 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
diegomura/react-pdf#3551 · 2 reactions ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
Maintainers usually reply within 1 day
All issues in diegomura/react-pdf
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
"Claude Code request is missing its initial user message" when the prompt starts with an image pathOpen
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
earendil-works/pi-claude-code#31 ·
Maintainers usually reply within 8 days
-
bug pending triage
Difficulty 1/5 Under an hour Newbie friendliness 92/100
privatenumber/cleye#48 ·
-
Google text documents are base64-encoded twicePossibly taken @feiiiiii5 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day