mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-07-06 19:14:55 +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>
|
||||
);
|
||||
|
||||
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>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user