mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-07-27 02:14:50 +10:00
fix: add conditional flex:1 for nested list content to fix layout (#3198)
This commit is contained in:
committed by
GitHub
parent
5b8ab33888
commit
fa4c8adf78
@@ -128,6 +128,15 @@ 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
|
||||||
@@ -155,7 +164,7 @@ export const RichText = ({ children }: RichTextProps) => {
|
|||||||
>
|
>
|
||||||
<View style={{ flexDirection: "row", alignItems: "flex-start" }}>
|
<View style={{ flexDirection: "row", alignItems: "flex-start" }}>
|
||||||
{markerNode}
|
{markerNode}
|
||||||
{children}
|
<View style={hasNestedList ? { flex: 1 } : {}}>{children}</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user