mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-07-08 12:04:52 +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>
|
||||
);
|
||||
|
||||
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
|
||||
@@ -155,7 +164,7 @@ export const RichText = ({ children }: RichTextProps) => {
|
||||
>
|
||||
<View style={{ flexDirection: "row", alignItems: "flex-start" }}>
|
||||
{markerNode}
|
||||
{children}
|
||||
<View style={hasNestedList ? { flex: 1 } : {}}>{children}</View>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user