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
2026-04-01 12:00:00 +08:00
committed by GitHub
parent 87b95bfc14
commit 4ba3fd84bf

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