Skip to content

Commit

Permalink
fix: change default value of input type from null to text (rrweb-io#1200
Browse files Browse the repository at this point in the history
)

* 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
  • Loading branch information
re-fort authored and eoghanmurray committed Jul 27, 2023
1 parent 184d6fb commit 0a2deb5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/rrweb-snapshot/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ export function isNodeMetaEqual(a: serializedNode, b: serializedNode): boolean {
* where passwords should be masked.
*/
export function getInputType(element: HTMLElement): Lowercase<string> | null {
// when omitting the type of input element(e.g. <input />), the type is treated as text
const type = (element as HTMLInputElement).type;

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

0 comments on commit 0a2deb5

Please sign in to comment.