fix: Fix input.type check (#1184)

* fix: Fix input.type check

Actually I noticed that `el.type` returns `text` when type is not explicitly set, so this is slightly incorrect.

* fix linting

* Apply formatting changes
This commit is contained in:
Francesco Novy
2026-04-01 12:00:00 +08:00
committed by GitHub
parent ea9033fc08
commit 6360042d33
9 changed files with 298 additions and 23 deletions

View File

@@ -20,6 +20,7 @@ import {
maskInputValue,
isNativeShadowDom,
getCssRulesString,
getInputType,
} from './utils';
let _id = 1;
@@ -682,11 +683,7 @@ function serializeElementNode(
attributes.type !== 'button' &&
value
) {
const type: string | null = n.hasAttribute('data-rr-is-password')
? 'password'
: typeof attributes.type === 'string'
? attributes.type.toLowerCase()
: null;
const type = getInputType(n);
attributes.value = maskInputValue({
type,
tagName,