[bug] write_html: hug column with a centered, width:100% text gets a huge height inside an absolute parent #22

Closed
opened 2026-10-25 15:46:42 +00:00 by masi · 0 comments
Owner

Expected: a flex column with height fit-content wraps its two text children (about 108px).
Actual: right after write_html it measured 1788px tall, which pushed the content below it out of the visible area. Running update_styles {height:"fit-content"} on the same node fixed it (108px).
Repro: write_html into a 390x844 artboard: <div style="position:absolute;left:0px;top:400px;width:390px;height:fit-content;display:flex;flex-direction:column;align-items:center;padding:24px"><div style="display:flex;flex-direction:column;align-items:center;gap:8px;width:100%"><div style="font-size:20px;line-height:28px;text-align:center">Short title</div><div style="width:100%;font-size:16px;line-height:24px;text-align:center">A sentence long enough to wrap onto two or three lines in this column.</div></div></div>, then get_tree_summary on the inner column.
Workaround: update_styles {height:"fit-content"} on the inner column after the write.
Impact: sheets and dialogs render empty below the title until someone notices.


Filed from PaperCraft 0.7.2 (macos).

**Expected:** a flex column with height fit-content wraps its two text children (about 108px). **Actual:** right after write_html it measured 1788px tall, which pushed the content below it out of the visible area. Running update_styles {height:"fit-content"} on the same node fixed it (108px). **Repro:** write_html into a 390x844 artboard: `<div style="position:absolute;left:0px;top:400px;width:390px;height:fit-content;display:flex;flex-direction:column;align-items:center;padding:24px"><div style="display:flex;flex-direction:column;align-items:center;gap:8px;width:100%"><div style="font-size:20px;line-height:28px;text-align:center">Short title</div><div style="width:100%;font-size:16px;line-height:24px;text-align:center">A sentence long enough to wrap onto two or three lines in this column.</div></div></div>`, then get_tree_summary on the inner column. **Workaround:** update_styles {height:"fit-content"} on the inner column after the write. **Impact:** sheets and dialogs render empty below the title until someone notices. --- Filed from PaperCraft 0.7.2 (macos).
masi closed this issue 2026-10-25 16:05:16 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: masi/papercraft#22