Skip to content

Commit a6ebb94

Browse files
authored
fix: markdown thumbnail blank capture — replace visibility:hidden with off-screen positioning (#235)
html-to-image (toPng) clones the DOM node with computed styles intact, so visibility:hidden produced a blank PNG. Use left:-9999 off-screen positioning instead, matching the IframeCapture pattern.
1 parent b5d01fa commit a6ebb94

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

ui/src/components/ThumbnailGenerator.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,14 +215,12 @@ function DomCapture({
215215
ref={containerRef}
216216
style={{
217217
position: "fixed",
218-
left: 0,
219-
top: 0,
218+
left: -9999,
219+
top: -9999,
220220
width: THUMB_WIDTH,
221221
height: THUMB_HEIGHT,
222222
overflow: "hidden",
223223
pointerEvents: "none",
224-
visibility: "hidden",
225-
zIndex: -1,
226224
background: "white",
227225
color: "black",
228226
fontSize: 12,

0 commit comments

Comments
 (0)