This repository was archived by the owner on Sep 8, 2020. It is now read-only.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 paste26091987into it the resulting value would be26.09.1987which 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:
selectionStartalways returns the end (10 in this case), so I'd be happy if you pointed me how to do this.