Skip to content

Commit 4015564

Browse files
re-forteoghanmurray
authored andcommitted
fix: change default value of input type from null to text (rrweb-io#1200)
* fix: change default value of input type from null to text * Apply formatting changes * add changeset * add a comment related to the type of input element
1 parent 4fbd93a commit 4015564

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/rrweb-snapshot/src/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ export function isNodeMetaEqual(a: serializedNode, b: serializedNode): boolean {
256256
* where passwords should be masked.
257257
*/
258258
export function getInputType(element: HTMLElement): Lowercase<string> | null {
259+
// when omitting the type of input element(e.g. <input />), the type is treated as text
259260
const type = (element as HTMLInputElement).type;
260261

261262
return element.hasAttribute('data-rr-is-password')

0 commit comments

Comments
 (0)