Skip to content
This repository has been archived by the owner on Sep 8, 2020. It is now read-only.

ctrl+v #183

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

ctrl+v #183

wants to merge 1 commit into from

Conversation

k-one-o-two
Copy link
Contributor

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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant