diff --git a/src/renderer/src/utils/image.ts b/src/renderer/src/utils/image.ts index 53669bd29f..35385812e9 100644 --- a/src/renderer/src/utils/image.ts +++ b/src/renderer/src/utils/image.ts @@ -73,7 +73,10 @@ export const captureScrollable = async (elRef: React.RefObject + Pick< + CSSStyleDeclaration, + 'overflow' | 'overflowX' | 'overflowY' | 'height' | 'maxHeight' | 'width' | 'minWidth' + > > const savedStyles = new Map() const modifiedNodes: HTMLElement[] = [] @@ -135,10 +138,7 @@ export const captureScrollable = async (elRef: React.RefObject node.clientHeight - ) { + if (node.classList.contains('message-content-container') && node.scrollHeight > node.clientHeight) { save(node, ['maxHeight', 'overflow', 'overflowY', 'height']) node.style.maxHeight = 'none' node.style.overflow = 'visible' @@ -190,7 +190,10 @@ export const captureScrollable = async (elRef: React.RefObject((resolve, reject) => { htmlToImage