From 3c473eba7d743a1fed793fb2c58c0ce2f498b6e4 Mon Sep 17 00:00:00 2001 From: Billy Vong Date: Thu, 19 Oct 2023 19:13:07 -0400 Subject: [PATCH] fix: dimensions not being applied (#117) Dimensions are not being properly applied when you seek to a position in the replay. Need to use `setProperty`, otherwise the style attributes get lost. --- packages/rrweb-snapshot/src/rebuild.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/rrweb-snapshot/src/rebuild.ts b/packages/rrweb-snapshot/src/rebuild.ts index 97faedf1da..75ce0a32af 100644 --- a/packages/rrweb-snapshot/src/rebuild.ts +++ b/packages/rrweb-snapshot/src/rebuild.ts @@ -328,9 +328,9 @@ function buildNode( } if (name === 'rr_width') { - (node as HTMLElement).style.width = value.toString(); + (node as HTMLElement).style.setProperty('width', value.toString()); } else if (name === 'rr_height') { - (node as HTMLElement).style.height = value.toString(); + (node as HTMLElement).style.setProperty('height', value.toString()); } else if ( name === 'rr_mediaCurrentTime' && typeof value === 'number'