mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-24 18:50:56 +08:00
fix bug: 深色模式对话导出渲染不正确
This commit is contained in:
parent
653b133327
commit
b04f02ea96
@ -306,7 +306,18 @@ export const captureScrollableDiv = async (divRef: React.RefObject<HTMLDivElemen
|
||||
allowTaint: true, // Allow cross-origin images
|
||||
logging: false, // Disable logging
|
||||
imageTimeout: 0, // Disable image timeout
|
||||
backgroundColor: null,
|
||||
onclone: (clonedDoc) => {
|
||||
// 克隆时保留原始样式
|
||||
if (div.id) {
|
||||
const clonedDiv = clonedDoc.querySelector(`#${div.id}`) as HTMLElement
|
||||
if (clonedDiv) {
|
||||
const computedStyle = getComputedStyle(div)
|
||||
clonedDiv.style.backgroundColor = computedStyle.backgroundColor
|
||||
clonedDiv.style.color = computedStyle.color
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure all images in cloned document are loaded
|
||||
const images = clonedDoc.getElementsByTagName('img')
|
||||
return Promise.all(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user