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 258 forks source link

Cursor moves to the one before last position if select mask character and enter new values #245

Open vvnc opened 5 years ago

vvnc commented 5 years ago

Bug Steps to reproduce:

  1. Go to the official demo page: https://htmlpreview.github.io/?https://github.com/angular-ui/ui-mask/master/demo/index.html
  2. Select some mask e.g. (999) 999-9999
  3. Enter any characters in the "Masked input" field
  4. Put the cursor at the end
  5. Select characters including any mask character, e.g. - or )
  6. Enter any characters

Result: cursor is on the one before last position

Expected behaviour: cursor is on the last position

Demo:

mask-character-selection-input-bug