From 5f28a8d534117e2e747e0466f73f5b86833133c7 Mon Sep 17 00:00:00 2001 From: Yanzhen Yu Date: Wed, 1 Apr 2026 12:00:00 +0800 Subject: [PATCH] prevent scroll when dispatch focus --- 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 de2db2d3..26b6c892 100644 --- a/src/replay/index.ts +++ b/src/replay/index.ts @@ -380,7 +380,9 @@ export class Replayer { void this.mouse.offsetWidth; this.mouse.classList.add('active'); } else if (d.type === MouseInteractions.Focus) { - target.focus(); + target.focus({ + preventScroll: true, + }); } else { target.dispatchEvent(event); }