zdfs / toscani

This is a jQuery-based, progressively-enhanced solution for creating a single-field credit card input. The idea is to create a more streamlined credit card entry process.
872 stars 102 forks source link

Cannot change month/year #17

Open tordans opened 11 years ago

tordans commented 11 years ago

To reproduce the error: – enter credit card number -> focus changes to month/year – enter 12 – 12 as month and year -> focus changes to cvv – use shift+tab to go back to the month-year-input to change it ERROR: The "12/12" is selected but cannot be changed anymore SHOULD: The "12/12" is selected but can be over-written by simply typing new diggits

System: Google Chrome Version 24.0.1312.57

Note: This might be the same issue as https://github.com/zdfs/toscani/issues/14 since I have this problem as well…

jme783 commented 10 years ago

We are implementing toscani and are currently experiencing this same issue. Is there any update on how to correct this?

kpowerinfinity commented 10 years ago

Having the same issue. Is there an update for this issue? Thanks!

wgaggioli commented 9 years ago

From what I can tell, this is caused by the rather cavalier call to unbind here: https://github.com/zdfs/toscani/blob/master/paymentInfo/assets/scripts/app.js#L234

This unbinds the keydown handler within inputmask, which causes inputmask to never reset its skipKeyPressEvent flag.

I can verify that removing line 234 fixes the issue. However, the part I can't figure out is why it's working for the other inputs, because unbind is used without regard throughout this whole plugin. I tried to track it down, but ultimately had to pull out.

I would submit a PR for this fix, but I don't fully understand why you are calling unbind so much to begin with. Should you be using namespaces, or do you actually mean to detach all event handlers? I am happy to submit a PR to fix the issue with some further clarification.