This repository was archived by the owner on Dec 11, 2017. It is now read-only.
Clear buffer in checkVal() to fix input duplication#175
Closed
JustinMoss wants to merge 1 commit intodigitalBush:masterfrom
Closed
Clear buffer in checkVal() to fix input duplication#175JustinMoss wants to merge 1 commit intodigitalBush:masterfrom
JustinMoss wants to merge 1 commit intodigitalBush:masterfrom
Conversation
This was referenced Oct 7, 2014
Owner
|
Merged #256 because it had a test. |
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.
I ran into an issue with masking input fields when entering values at the end of the mask, leaving the field, then re-entering. When leaving the field, the input would shift left, then when re-entering the field the left shifted value would remain, but the original value would also be present. I'll show an example below:
Step 1. Click or tab into an empty input and you will see an empty mask:
(___) ___-____Step 2. Enter a value at the end of the mask :
(___) ___-__34Step 3. Leave the input and the value shifts to the left:
(34_) ___-____Step 4. Click or tab back into the input and both the shifted and original values appear:
(34_) ___-__34In order to fix this issue, I added a line to clear the remaining parts of the buffer after the value is shifted to the left.
I tried to run the unit tests and it appeared the ones that passed before my change stll passed after, but I'm very new to jquery unit tests. If you have any suggestions for what sort of tests I could do for this fix, I'll happily add them.
I did not make this change to the minified version, but I can do so if you let me know what your favorite minifier is.