From 776d9d38400c1d66dc541dbb3c170bbed08d6ecc Mon Sep 17 00:00:00 2001 From: Nantiwat Thongseng Date: Thu, 28 Jul 2016 15:27:01 +0700 Subject: [PATCH] you can paste credit card number when you use safari or 1password --- src/format.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/format.js b/src/format.js index 68455cf..2491f9c 100644 --- a/src/format.js +++ b/src/format.js @@ -40,6 +40,10 @@ angular.module('angularPayments') return; } + if ((e.metaKey || e.ctrlKey) && e.which === 118) { + return; + } + if (!/^\d+$/.test(digit) && !e.meta && e.keyCode >= 46) { e.preventDefault(); return; @@ -363,4 +367,4 @@ angular.module('angularPayments') _Format(attr.paymentsFormat, elem, ctrl); } } -}]) \ No newline at end of file +}])