mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-07-09 20:44:53 +10:00
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:
@@ -128,13 +128,6 @@ export const RichText = ({ children }: RichTextProps) => {
|
|||||||
</PdfText>
|
</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.
|
// Same BiDi-injection trick as the <p> renderer — see applyRtlDirectionRecursively.
|
||||||
const contentNode = rtl ? (
|
const contentNode = rtl ? (
|
||||||
<PdfText
|
<PdfText
|
||||||
@@ -162,7 +155,7 @@ export const RichText = ({ children }: RichTextProps) => {
|
|||||||
>
|
>
|
||||||
<View style={{ flexDirection: "row", alignItems: "flex-start" }}>
|
<View style={{ flexDirection: "row", alignItems: "flex-start" }}>
|
||||||
{markerNode}
|
{markerNode}
|
||||||
<View style={hasNestedList ? { flex: 1 } : {}}>{children}</View>
|
<View style={{ flex: 1, minWidth: 0 }}>{children}</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user