Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 23 additions & 19 deletions packages/rrweb/src/record/observer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@
| IncrementalSource.TouchMove
| IncrementalSource.Drag,
) => {
const totalOffset = Date.now() - timeBaseline!;

Check warning on line 212 in packages/rrweb/src/record/observer.ts

View workflow job for this annotation

GitHub Actions / Lint and Measure Bundle Sizes

typescript(no-non-null-assertion)

packages/rrweb/src/record/observer.ts:212:42: Forbidden non-null assertion.

Check warning on line 212 in packages/rrweb/src/record/observer.ts

View workflow job for this annotation

GitHub Actions / Lint and Measure Bundle Sizes

typescript(no-non-null-assertion)

packages/rrweb/src/record/observer.ts:212:42: Forbidden non-null assertion.
mousemoveCb(
positions.map((p) => {
p.timeOffset -= totalOffset;
Expand Down Expand Up @@ -558,25 +558,29 @@
// the other radios with the same name attribute will be unchecked.
const name: string | undefined = (target as HTMLInputElement).name;
if (type === 'radio' && name && isChecked) {
doc
.querySelectorAll(`input[type="radio"][name="${name}"]`)
.forEach((el) => {
if (el !== target) {
const text = maskInputValue({
// share mask behavior of `target`
isMasked: forceMask,
element: el as HTMLInputElement,
value: getInputValue(el as HTMLInputElement, tagName, type),
maskInputFn,
});
cbWithDedup(
el,
userTriggeredOnInput
? { text, isChecked: !isChecked, userTriggered: false }
: { text, isChecked: !isChecked },
);
}
});
// Avoid building a CSS selector from the name: names can contain
// characters (e.g. quotes) that make the selector invalid.
Array.from(doc.getElementsByName(name)).forEach((el) => {
if (
el !== target &&
el.tagName.toLowerCase() === 'input' &&
(el as HTMLInputElement).type?.toLowerCase() === 'radio'
) {
const text = maskInputValue({
// share mask behavior of `target`
isMasked: forceMask,
element: el as HTMLInputElement,

Check failure on line 572 in packages/rrweb/src/record/observer.ts

View workflow job for this annotation

GitHub Actions / Lint and Measure Bundle Sizes

typescript(no-unnecessary-type-assertion)

packages/rrweb/src/record/observer.ts:572:22: This assertion is unnecessary since the receiver accepts the original type of the expression.

Check failure on line 572 in packages/rrweb/src/record/observer.ts

View workflow job for this annotation

GitHub Actions / Lint and Measure Bundle Sizes

typescript(no-unnecessary-type-assertion)

packages/rrweb/src/record/observer.ts:572:22: This assertion is unnecessary since the receiver accepts the original type of the expression.
value: getInputValue(el as HTMLInputElement, tagName, type),
maskInputFn,
});
cbWithDedup(
el,
userTriggeredOnInput
? { text, isChecked: !isChecked, userTriggered: false }
: { text, isChecked: !isChecked },
);
}
});
}
}
function cbWithDedup(target: EventTarget, v: inputValue) {
Expand Down
Loading