diff --git a/src/snapshot.ts b/src/snapshot.ts index 4c17612f..81d8e83f 100644 --- a/src/snapshot.ts +++ b/src/snapshot.ts @@ -309,8 +309,11 @@ function serializeNode( } if (needBlock) { const { width, height } = (n as HTMLElement).getBoundingClientRect(); - attributes.rr_width = `${width}px`; - attributes.rr_height = `${height}px`; + attributes = { + class: attributes.class, + rr_width: `${width}px`, + rr_height: `${height}px`, + }; } return { type: NodeType.Element, diff --git a/test/__snapshots__/integration.ts.snap b/test/__snapshots__/integration.ts.snap index f5c84e18..43bb79cd 100644 --- a/test/__snapshots__/integration.ts.snap +++ b/test/__snapshots__/integration.ts.snap @@ -70,7 +70,7 @@ exports[`[html file]: block-element.html 1`] = `
record 2
-
+
" `;