Skip to content

Commit 01c1663

Browse files
committed
Update ScreenCapture.js
1 parent 274f719 commit 01c1663

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/ScreenCapture.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,13 +362,17 @@ const extractFinalCSSState = (element) => {
362362

363363
// Extract only the keys (CSS properties) from the final keyframe
364364
Object.keys(finalKeyframe).forEach((property) => {
365-
if (property !== 'offset') {
365+
if (property !== "offset") {
366366
// Store the computed style for each animated property
367367
finalCSSState[property] = getComputedStyle(element)[property];
368368
}
369369
});
370370
});
371371

372+
if (Object.keys(finalCSSState).length === 0) {
373+
return null;
374+
}
375+
372376
return JSON.stringify(finalCSSState);
373377
}
374378

0 commit comments

Comments
 (0)