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

Validate digit and reorder test. #50

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

alexismartin
Copy link

Fixes issue #49 and #51.

Fixes backspace problem on Firefox.
Test length after testing for digit validity to disable letter input on last digit.
@alexismartin alexismartin changed the title Add test to validate digit. Validate digit and reorder test. Sep 9, 2014
@tjwallace
Copy link

+1

1 similar comment
@jamesbrobb
Copy link

+1

@jamesbrobb
Copy link

@alexismartin i've noticed that there's also a (mildly annoying but not fatal) issue when deleting the expiry date in firefox. The backslash is deleted on key down, but then re-added on press by the _formatForwardExpiry handler method

line 333 needs to be changed from

if (/^\d\d$/.test(val)) {

to

if (/^\d\d$/.test(val) && /^\d+$/.test(digit)) {

That said, i can't actually see the purpose of the _formatForwardExpiry handler method, as the existing conditional logic only equates to true when the delete key is being pressed. Otherwise _formatExpiry deals with adding the forward slash as the user types.

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.

3 participants