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.
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 paste26091987
into it the resulting value would be26.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.