ui-mask icon indicating copy to clipboard operation
ui-mask copied to clipboard

ctrl+v

Open k-one-o-two opened this issue 9 years ago • 0 comments

Pasting into fields with a mask now puts the cursor into the correct place.

The issue: if there is a field like this <input type="text" ui-mask="39.19.2999" placeholder="__.__.____" ng-model="data.birthDate"/> and you paste 26091987 into it the resulting value would be 26.09.1987 which is correct.

But the caret position is in the wrong place - before the "87". It's because masked value is 2 digits longer then the unmasked.

This PR fixes the issue.

However I don't know how to write a test for that: selectionStart always returns the end (10 in this case), so I'd be happy if you pointed me how to do this.

k-one-o-two avatar Aug 31 '16 16:08 k-one-o-two