Skip to content
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

[Bug]: genTextAreaValueMutation doesn't seem to mask attribute.value #1596

Open
1 task done
sdemjanenko opened this issue Nov 8, 2024 · 0 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@sdemjanenko
Copy link

Preflight Checklist

  • I have searched the issue tracker for a bug report that matches the one I want to file, without success.

What package is this bug report for?

rrweb-snapshot

Version

2.0.0-alpha.17

Expected Behavior

I have a React app that controls a textarea by setting the value prop. RRWeb records the attribute change as well as the change event. The data looks like

Attribute change event:

{
    "adds": [],
    "attributes": [
        {
            "attributes": {
                "value": "(903) 993-7305"
            },
            "id": 121
        }
    ],
    "removes": [],
    "source": 0,
    "texts": []
} 

Input change event:

{
    "id": 121,
    "isChecked": false,
    "source": 5,
    "text": "**************"
}

I am expecting the attributes.value to be masked.

Actual Behavior

The attributes.value is unmasked. The issue appears to be in genTextAreaValueMutation, specifically the code

item.attributes.value = Array.from(
  dom.childNodes(textarea),
  (cn) => dom.textContent(cn) || '',
).join('');

There doesn't appear to be any masking logic that is applied to this value (or upstream of this function).

Steps to Reproduce

Create a controlled textarea in React.

Testcase Gist URL

No response

Additional Information

No response

@sdemjanenko sdemjanenko added the bug Something isn't working label Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant