diff --git a/src/replay/index.ts b/src/replay/index.ts index bb816f2f..27363388 100644 --- a/src/replay/index.ts +++ b/src/replay/index.ts @@ -74,6 +74,7 @@ export class Replayer { blockClass: 'rr-block', liveMode: false, insertStyleRules: [], + triggerFocus: true, }; this.config = Object.assign({}, defaultConfig, config); @@ -494,6 +495,7 @@ export class Replayer { type: d.type, target, }); + const { triggerFocus } = this.config; switch (d.type) { case MouseInteractions.Blur: if (((target as Node) as HTMLElement).blur) { @@ -501,7 +503,7 @@ export class Replayer { } break; case MouseInteractions.Focus: - if (((target as Node) as HTMLElement).focus) { + if (triggerFocus && ((target as Node) as HTMLElement).focus) { ((target as Node) as HTMLElement).focus({ preventScroll: true, }); diff --git a/src/types.ts b/src/types.ts index a39ca027..063d40bb 100644 --- a/src/types.ts +++ b/src/types.ts @@ -318,6 +318,7 @@ export type playerConfig = { blockClass: string; liveMode: boolean; insertStyleRules: string[]; + triggerFocus: boolean; }; export type playerMetaData = {