fix: wrap list item content in flex View so bullets respect margin (#3202)

* fix(pdf): wrap list item content in flex View so bullets respect margin

* fix(pdf): add minWidth 0 to bullet content so long text wraps
This commit is contained in:
Shanu S
2026-07-04 12:50:01 +05:30
committed by GitHub
parent 578a983209
commit ee970f2961
@@ -128,13 +128,6 @@ export const RichText = ({ children }: RichTextProps) => {
</PdfText>
);
let hasNestedList = false;
if (Array.isArray(children)) {
hasNestedList = children.some(
(child) => child?.props?.element?.rawTagName === "ul" || child?.props?.element?.rawTagName === "ol",
);
}
// Same BiDi-injection trick as the <p> renderer — see applyRtlDirectionRecursively.
const contentNode = rtl ? (
<PdfText
@@ -162,7 +155,7 @@ export const RichText = ({ children }: RichTextProps) => {
>
<View style={{ flexDirection: "row", alignItems: "flex-start" }}>
{markerNode}
<View style={hasNestedList ? { flex: 1 } : {}}>{children}</View>
<View style={{ flex: 1, minWidth: 0 }}>{children}</View>
</View>
</View>
);