fix mask textarea
This commit is contained in:
@@ -237,6 +237,8 @@ function serializeNode(
|
|||||||
tagName === 'select'
|
tagName === 'select'
|
||||||
) {
|
) {
|
||||||
const value = (n as HTMLInputElement | HTMLTextAreaElement).value;
|
const value = (n as HTMLInputElement | HTMLTextAreaElement).value;
|
||||||
|
const needBlockTextarea =
|
||||||
|
tagName === 'textarea' && maskInputOptions.textarea;
|
||||||
if (
|
if (
|
||||||
attributes.type !== 'radio' &&
|
attributes.type !== 'radio' &&
|
||||||
attributes.type !== 'checkbox' &&
|
attributes.type !== 'checkbox' &&
|
||||||
@@ -244,9 +246,9 @@ function serializeNode(
|
|||||||
attributes.type !== 'button' &&
|
attributes.type !== 'button' &&
|
||||||
value
|
value
|
||||||
) {
|
) {
|
||||||
attributes.value = maskInputOptions[
|
attributes.value =
|
||||||
attributes.type as keyof MaskInputOptions
|
maskInputOptions[attributes.type as keyof MaskInputOptions] ||
|
||||||
]
|
needBlockTextarea
|
||||||
? '*'.repeat(value.length)
|
? '*'.repeat(value.length)
|
||||||
: value;
|
: value;
|
||||||
} else if ((n as HTMLInputElement).checked) {
|
} else if ((n as HTMLInputElement).checked) {
|
||||||
|
|||||||
@@ -83,4 +83,6 @@ export type MaskInputOptions = Partial<{
|
|||||||
time: boolean;
|
time: boolean;
|
||||||
url: boolean;
|
url: boolean;
|
||||||
week: boolean;
|
week: boolean;
|
||||||
|
// unify textarea element with text input
|
||||||
|
textarea: boolean;
|
||||||
}>;
|
}>;
|
||||||
|
|||||||
Reference in New Issue
Block a user