candreoliveira / ngMask

Best Angular mask alternative! No jQuery, pure JS. About ~6kb!
http://candreoliveira.github.io/#/ngMask
ISC License
419 stars 171 forks source link

Unexpected behavior with '?' inside '()' #128

Closed akudrytski closed 7 years ago

akudrytski commented 7 years ago

Hello, I've got and unexpected behavior. Using following pattern mask="(999?) 999-9999" results in the following results on input "(111 111-1111" and "(11) 111-1111", where the first variant is incorrect -- closing parenthesis missing. Could you please clarify how do I make closing parenthesis appear? Thank you.

akudrytski commented 7 years ago

Removing space after the closing parenthesis "(999?)999-9999" made the logic work correctly. Believe the issue is still out there, however workaround brings to the desired result.