support mask select fields
This commit is contained in:
@@ -237,8 +237,6 @@ 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' &&
|
||||||
@@ -248,7 +246,7 @@ function serializeNode(
|
|||||||
) {
|
) {
|
||||||
attributes.value =
|
attributes.value =
|
||||||
maskInputOptions[attributes.type as keyof MaskInputOptions] ||
|
maskInputOptions[attributes.type as keyof MaskInputOptions] ||
|
||||||
needBlockTextarea
|
maskInputOptions[tagName as keyof MaskInputOptions]
|
||||||
? '*'.repeat(value.length)
|
? '*'.repeat(value.length)
|
||||||
: value;
|
: value;
|
||||||
} else if ((n as HTMLInputElement).checked) {
|
} else if ((n as HTMLInputElement).checked) {
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ export type MaskInputOptions = Partial<{
|
|||||||
time: boolean;
|
time: boolean;
|
||||||
url: boolean;
|
url: boolean;
|
||||||
week: boolean;
|
week: boolean;
|
||||||
// unify textarea element with text input
|
// unify textarea and select element with text input
|
||||||
textarea: boolean;
|
textarea: boolean;
|
||||||
|
select: boolean;
|
||||||
}>;
|
}>;
|
||||||
|
|||||||
Reference in New Issue
Block a user