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

Autocomplete / Autofix with enum #951

Closed
Vincz opened this issue Sep 25, 2023 · 3 comments
Closed

Autocomplete / Autofix with enum #951

Vincz opened this issue Sep 25, 2023 · 3 comments

Comments

@Vincz
Copy link

Vincz commented Sep 25, 2023

What problem you are trying to solve?
I'd like to auto-complete and auto-fix an enum mask. For example, let's say I have an enum with "Jan", "Nov", "Dec".

Describe the solution you'd like
If the user input "N", it auto-complete to "Nov" as it's the only value matching.
Also, if the user input "n", it fixes it to "N" and... autocomplete the rest as above.

Describe alternatives you've considered
No alternative considered.

@uNmAnNeR
Copy link
Owner

Nice feature, but seems to me to be outside the scope of masking.

@uNmAnNeR
Copy link
Owner

case-insensitive comparison can be done using matchValue option, e.g.:

matchValue: (estr, istr, matchFrom) => IMask.MaskedEnum.DEFAULTS.matchValue(estr.toLowerCase(), istr.toLowerCase(), matchFrom),

@joacub
Copy link

joacub commented Mar 10, 2024

this fails when pasting, eliminates chars

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

No branches or pull requests

3 participants