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

MaskedTextChangedListener implementation bug #24

Open
derkicker opened this issue Nov 14, 2021 · 2 comments
Open

MaskedTextChangedListener implementation bug #24

derkicker opened this issue Nov 14, 2021 · 2 comments

Comments

@derkicker
Copy link

Came across an issue with mask format. When a textChangedListener is installed on a text edit it uses number example to make a mask. Problem is that number example is just on of the possible variants of the input so using it for the mask restricts from another valid input of different format.

Example:
Indonesian mobile number + 62 812 111-222-33 which is perfectly valid, it's number pattern in the google lib is 8[1-35-9]\d{7,10}.
It's impossible to input the whole number because textChangedListener uses short variant of mask +[00] [000]-[000]-[000] so it allows only + 62 812 111-222.

The workaround is using a widest possible mask format i guess.

@ibrahimsn98
Copy link
Owner

Hi @derkicker do you have any suggestion to cover that case? As far as I know lilphonenumber provides just 1 sample number for the given country code.

@derkicker
Copy link
Author

Hi @ibrahimsn98! I'd suggest using possibleLengths block from resources:

image

image

So we could get max value from mobile.possibleLength_ and compose a mask of that length

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

2 participants