Megabit / Blazorise

Blazorise is a component library built on top of Blazor with support for CSS frameworks like Bootstrap, Tailwind, Bulma, AntDesign, and Material.
https://blazorise.com/
Other
3.26k stars 527 forks source link

InputMask and hiding contents #4781

Open grumpykiwi opened 1 year ago

grumpykiwi commented 1 year ago

Is it possible to use an inputmask component for input of a Social Security Number where when the SSN is entered and focus is lost, the actual value is masked by a specified string such as "XXX-XX-XXXX" and revealed again when focus is regained?

stsrki commented 1 year ago

At the moment, it is not possible. Under the hood, we're using the library https://github.com/RobinHerbots/Inputmask, and as far as I can see, there is no option to hide value after the focus is lost. It might be good to request that feature in their repo and hopefully, we could add it also on our side.

You could try to use JS and hook to the focus events as a workaround. You can also try using input as a password. It still behaves as mask input, but the value is hidden.

<InputMask type="password" Mask="99999" />