From 23220f1771e0971060b000be251c07e01fe98726 Mon Sep 17 00:00:00 2001 From: Eoghan Murray Date: Wed, 1 Apr 2026 12:00:00 +0800 Subject: [PATCH] Was experiencing case when a TouchEnd event occurred on a text element i.e. (nodeType: 3 / nodeName: #text) (#180) This was a recording taken with rrweb 0.7.27 (3afff63970d19ac17eac3dc026c7b2699021f042) and rrweb-snapshot 0.7.21 (a0dc9481b21fbbbdc590d8998f055676f2279cab) so issue may have been fixed in the intervening commits --- src/replay/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/replay/index.ts b/src/replay/index.ts index 27363388..3cdf8013 100644 --- a/src/replay/index.ts +++ b/src/replay/index.ts @@ -683,7 +683,9 @@ export class Replayer { }); let currentEl: Element | null = el; while (currentEl) { - currentEl.classList.add(':hover'); + if (currentEl.classList) { + currentEl.classList.add(':hover'); + } currentEl = currentEl.parentElement; } }