Inputmask icon indicating copy to clipboard operation
Inputmask copied to clipboard

Is it possible to cover with asterisk partial of the user's input?

Open MikeAlhayek opened this issue 5 years ago • 3 comments

First of all, I want to say thank you for this great plugin! I have more of a question or feature request than a bug report.

Is it possible to cover with asterisk partial of the user's input?

For example, the US social security number is a nine digit number that fits the 999-99-9999 mask. This mask works great. However, since social security number is a sensitive data, I don't want to display the full number on the screen. Instead, I want to show only the last 4 digits.

If the social security number is 123-45-6789 then I want it to show as ***-**-6789. If the user is still typing, we would only hide the first characters. So if the user typed 7 out of 9 characters and still typing then we show ***-**67__ >> next key up ***-**678_ and finally ***-**6789

How can I create this behavior?

MikeAlhayek avatar Sep 29 '20 20:09 MikeAlhayek

Hi, did you find any solution?

serkandede avatar Nov 12 '20 21:11 serkandede

@CrestApps ,

That would indeed a nice extra feature. I will add such functionality.

RobinHerbots avatar Dec 01 '20 22:12 RobinHerbots

Could you please tell me how to use inputMask in react 18.

Requirement is as follows,

If the input number is 6765 6666 567, then I want to show it as **** **6 567. When user is typing, the digit should convert as asterisk() up to 13 digits and rest the numbers.

Few examples: 6765 6666 567 -> **** ***6 567 6765 6666 -> **** ***6 67 -> ** 6 -> *

Also, is it possible to get the unmasked number using any function as I need to show the actual number when used click on the eye icon.

How can we achieve this behavior using your library. Please advise @RobinHerbots @serkandede @MikeAlhayek image

Joset2022 avatar Jan 07 '23 15:01 Joset2022