Skip to content

Commit b42dda8

Browse files
committed
Fix bug: attributes weren't getting removed after changes to treatment of 'style' attributes
1 parent b59f1b4 commit b42dda8

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/replay/index.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,13 +1326,11 @@ export class Replayer {
13261326
for (const attributeName in mutation.attributes) {
13271327
if (typeof attributeName === 'string') {
13281328
const value = mutation.attributes[attributeName];
1329-
if (typeof value === 'string') {
1329+
if (value === null) {
1330+
((target as Node) as Element).removeAttribute(attributeName);
1331+
} else if (typeof value === 'string') {
13301332
try {
1331-
if (value !== null) {
1332-
((target as Node) as Element).setAttribute(attributeName, value);
1333-
} else {
1334-
((target as Node) as Element).removeAttribute(attributeName);
1335-
}
1333+
((target as Node) as Element).setAttribute(attributeName, value);
13361334
} catch (error) {
13371335
if (this.config.showWarning) {
13381336
console.warn(

0 commit comments

Comments
 (0)