Hotfix/firefox cvc#1
Conversation
| if (!/^\d+$/.test(digit) && !e.meta && e.keyCode >= 46) { | ||
|
|
||
| // Allows backspace, delete and arrow keys when input length is 4 and the browser is Firefox | ||
| if (e.keyCode == 46 || e.keyCode == 8||(e.keyCode >=37 && e.keyCode <=40)) { |
There was a problem hiding this comment.
how do you know that it is Firefox here?
There was a problem hiding this comment.
@raphaeldieu IE / Chrome / Safari detects the "keypress" event only when an actual character input is added. Since backspace and arrow keys don't add a new character, the function doesn't run.
For Firefox, the "keypress" event is run even on backspace / arrow keys and so with the old code when val.length is more than 4, it will always fall down to the else block which has a e.preventDefault() preventing the user from any form of input. The new code which detects arrow / delete / backspace keys therefore can only occur on firefox
| } | ||
| }]);angular.module('angularPayments') | ||
| }]) | ||
| ;angular.module('angularPayments') |
There was a problem hiding this comment.
ran grunt and I guess it changed the line. Didn't directly edit anything inside the /lib folder
Reference: laurihy#97