Skip to content

Commit 6c2d850

Browse files
committed
1 parent 924d2d9 commit 6c2d850

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/snapshot.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,11 @@ function serializeNode(
309309
}
310310
if (needBlock) {
311311
const { width, height } = (n as HTMLElement).getBoundingClientRect();
312-
attributes.rr_width = `${width}px`;
313-
attributes.rr_height = `${height}px`;
312+
attributes = {
313+
class: attributes.class,
314+
rr_width: `${width}px`,
315+
rr_height: `${height}px`,
316+
};
314317
}
315318
return {
316319
type: NodeType.Element,

test/__snapshots__/integration.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ exports[`[html file]: block-element.html 1`] = `
7070
<div class=\\"rr-block big\\" style=\\"width: 50px; height: 50px;\\"></div>
7171
<div>record 2</div>
7272
<div class=\\"rr-block small\\" style=\\"width: 50px; height: 100px;\\"></div>
73-
<div class=\\"rr-block\\" style=\\"height: 200px; width: 100px\\"></div>
73+
<div class=\\"rr-block\\" style=\\"width: 100px; height: 200px;\\"></div>
7474
</body></html>"
7575
`;
7676

0 commit comments

Comments
 (0)