feat: Ensure password inputs are masked when switching type (#1170)

* feat: Ensure password inputs are masked when switching type


Apply formatting changes

use data- attribute


ref: Ensure type is always lowercased


add changeset

* extract into util

* Apply formatting changes
This commit is contained in:
Francesco Novy
2023-03-20 13:13:23 +01:00
committed by GitHub
parent a82a3b42b1
commit d2582e9a81
9 changed files with 519 additions and 382 deletions

View File

@@ -674,8 +674,13 @@ 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;
attributes.value = maskInputValue({
type: attributes.type,
type,
tagName,
value,
maskInputOptions,