jessepollak / jessepollak/card
Injecting cc number via js doesn't update and fill in the visual card
- Dominant language
- SCSS
- Stars
- 11.7k
- Forks
- 1.5k
- PR merge metrics
- No merged PRs in 30d
Description
Amazing lib, thank you very much!
I am using Card.io to offer my user the ability to scan the cc number. After I receive the number I inject it into the input field. When I do this, the visual card up top does not update with the number in the field.
I'm guessing it's because your lib updates the visual card on a keydown or keyup event and when injecting with js this doesn't happen.
Is there a way to force the visual card to check it's dependent input field(s)? I tried $('myelement').keyup() and $('myelement').keydown() which would be the standard way tell a field to act as if that event happened but it didn't help. Only when typing in a number does the visual card update.
Also noticed that when injecting, the numbers insert without those nifty spaces:
-xxxxxxxxxxxxxxxx
instead of:
-xxxx xxxx xxxx xxxx
Contributor guide
Assessment
This issue has not been assessed yet.