feat: Added support maskInputFn with HTMLElement (#1188)
This commit is contained in:
@@ -154,12 +154,14 @@ export function createMirror(): Mirror {
|
||||
}
|
||||
|
||||
export function maskInputValue({
|
||||
element,
|
||||
maskInputOptions,
|
||||
tagName,
|
||||
type,
|
||||
value,
|
||||
maskInputFn,
|
||||
}: {
|
||||
element: HTMLElement;
|
||||
maskInputOptions: MaskInputOptions;
|
||||
tagName: string;
|
||||
type: string | null;
|
||||
@@ -174,7 +176,7 @@ export function maskInputValue({
|
||||
(actualType && maskInputOptions[actualType as keyof MaskInputOptions])
|
||||
) {
|
||||
if (maskInputFn) {
|
||||
text = maskInputFn(text);
|
||||
text = maskInputFn(text, element);
|
||||
} else {
|
||||
text = '*'.repeat(text.length);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user