-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: masking on textarea #43
fix: masking on textarea #43
Conversation
If textarea has a child string content, it will get duplicated as a `value` attribute. Masking by text vs input can cause these two values to diverge (i.e. only one is masked). On playback, we remove duplicate textContent for textareas, which means we could show double textarea values: one masked, one unmasked.
packages/rrweb-snapshot/src/utils.ts
Outdated
@@ -28,6 +28,7 @@ export function maskInputValue({ | |||
value: string | null; | |||
maskInputFn?: MaskInputFn; | |||
}): string { | |||
console.log('maskInputValue', tagName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want this log or is it a debugging leftover?
@@ -590,6 +590,20 @@ describe('record integration tests', function (this: ISuite) { | |||
assertSnapshot(snapshots); | |||
}); | |||
|
|||
it.only('should mask only inputs', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the only
intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, what happens when I don't have precommit linters
Merging this fix so it can go out with todays release! |
damn, just noticed this doesn't go into develop, but into another feature branch 😅 hope I didn't mess anything up, sorry. I guess we can just fix this in the next release then 👍 |
If textarea has a child string content, it will get duplicated as a `value` attribute. Masking by text vs input can cause these two values to diverge (i.e. only one is masked). On playback, we remove duplicate textContent for textareas, which means we could show double textarea values: one masked, one unmasked.
Fix bug introduced in #43 where we masked both textarea's `value` and `textContent`, which meant the text inside of the textarea would get duplicated. We can ignore `textContent` in this case and set it to an empty string.
If textarea has a child string content, it will get duplicated as a
value
attribute. Masking by text vs input can cause these two values to diverge (i.e. only one is masked). On playback, we remove duplicate textContent for textareas, which means we could show double textarea values: one masked, one unmasked.