angular-ui / ui-mask

Mask on an input field so the user can only type pre-determined pattern
https://htmlpreview.github.io/?https://github.com/angular-ui/ui-mask/master/demo/index.html
MIT License
391 stars 257 forks source link

Caret skips to second digit on focus when phone number already present #232

Open anjhinz opened 6 years ago

anjhinz commented 6 years ago

Can be seen here: http://plnkr.co/edit/CDG941601WdHPMEdlEdG?p=preview

Type a phone number (that does NOT contain any 5's). Shift+Tab to lose focus, then Tab to focus phone number text field. Cursor skips to after the first digit after a half second pause.

Update: Problem seems to be from both 'focus' and 'keyup' events being handled, both moving the cursor one forward because of the "(" in the placeholder.