Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mask option to Text Type #400

Open
Marcelo-Petrucelli opened this issue Jul 12, 2023 · 0 comments
Open

Add mask option to Text Type #400

Marcelo-Petrucelli opened this issue Jul 12, 2023 · 0 comments

Comments

@Marcelo-Petrucelli
Copy link

Marcelo-Petrucelli commented Jul 12, 2023

Is your feature request related to a problem?

No. The main idea is to allow text input to be masked (possibly in the same way as the date type)

Describe the solution you'd like

It would be nice to have the mask option on the text type or any other interesting type.

Describe alternatives you've considered

I wouldn't like to make things complicated so I have a simple and a complex solution:

Simple:
Something very similar to #241 but for every character. If it exceeds the format, simply append to the text.

Complex:
The Mask would become an array of regex. On render, changes the current value of the prompt would be matched against every element of the array. By order, the first matching regex would then mask the value of the prompt.

A sample can be found at: https://text-mask.github.io/text-mask/

Additional context

There would be no additional context. If I have the time I'll sure think of ways of doing this and try to make a pull request. Sorry for asking something without offering much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant