fix: change default value of input type from null to text (#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
This commit is contained in:
re-fort
2023-04-14 17:04:02 +09:00
committed by GitHub
parent f88471184c
commit 94d06536e3

View File

@@ -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')