Skip to content
This repository has been archived by the owner on Sep 8, 2020. It is now read-only.

Glitch if mask contains prefix and prefix has space character #228

Open
jrencz opened this issue Aug 9, 2017 · 0 comments
Open

Glitch if mask contains prefix and prefix has space character #228

jrencz opened this issue Aug 9, 2017 · 0 comments

Comments

@jrencz
Copy link

jrencz commented Aug 9, 2017

I have 2 fields in my project requiring mask to have some prefix.
Prefix is supposed to be shown inside the field (just as mask is)

Another story is that I have my own directive to apply this prefix
to both mask and model value for my own convenience, but this
bug is not related to that code since I was able to reproduce it
on Codepen (linked below)

Current latest release of uiMask (1.8.7) has a bug that causes
characters from prefix occurring after a space characterto be
copied into masked part of the input in case prefix has space
character in it if one of prefix characters happens to be a meaningful
character for the mask.

e.g. if prefix is 1234 89 and then mask is 99 9999 9999
(I'm interested in gathering last 10 out of 16 digits of Payback card)
when field is focused value becomes
1234 8989 ____ ____ instead of expected
1234 89__ ____ ____

Additional 89 is removed on blur unless clearOnBlur is set to false
(which is my case). If it's set to true on each focus another 89 is
added to model.

What's interesting: Replacing space with a non-breaking space
in the prefix only is a workaround.

Example presenting all above: https://codepen.io/jrencz/pen/GvmxyL

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

No branches or pull requests

1 participant