restricted-input
Advanced tools
Comparing version 1.2.7 to 2.0.0
# Restricted Input - Release Notes | ||
## 2.0.0 | ||
* Fix bug in iOS Chrome where autofill may not format correctly | ||
_Breaking Changes_ | ||
* Inputs initialize in formatted state if input has a preset value | ||
## 1.2.7 (2017-11-01) | ||
@@ -4,0 +12,0 @@ |
@@ -1,2 +0,2 @@ | ||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.RestrictedInput = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.RestrictedInput = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ | ||
'use strict'; | ||
@@ -44,2 +44,3 @@ | ||
ua = ua || UA; | ||
return /SamsungBrowser/.test(ua) || _isOldSamsungBrowserOrSamsungWebview(ua); | ||
@@ -519,2 +520,6 @@ } | ||
this._attachListeners(); | ||
if (this.inputElement.value) { | ||
this._reformatInput(); | ||
} | ||
} | ||
@@ -688,3 +693,3 @@ | ||
delete this._stateToFormat; | ||
} else if (selection.start === input.value.length) { | ||
} else if (selection.start === input.value.length && this.isFormatted) { | ||
stateToFormat = this.formatter.unformat(stateToFormat); | ||
@@ -992,2 +997,2 @@ } | ||
},{"./lib/device":2}]},{},[17])(17) | ||
}); | ||
}); |
@@ -32,2 +32,3 @@ 'use strict'; | ||
ua = ua || UA; | ||
return /SamsungBrowser/.test(ua) || _isOldSamsungBrowserOrSamsungWebview(ua); | ||
@@ -34,0 +35,0 @@ } |
@@ -16,2 +16,6 @@ 'use strict'; | ||
this._attachListeners(); | ||
if (this.inputElement.value) { | ||
this._reformatInput(); | ||
} | ||
} | ||
@@ -185,3 +189,3 @@ | ||
delete this._stateToFormat; | ||
} else if (selection.start === input.value.length) { | ||
} else if (selection.start === input.value.length && this.isFormatted) { | ||
stateToFormat = this.formatter.unformat(stateToFormat); | ||
@@ -188,0 +192,0 @@ } |
{ | ||
"name": "restricted-input", | ||
"version": "1.2.7", | ||
"version": "2.0.0", | ||
"description": "Restrict inputs to certain valid characters (e.g. formatting phone or card numbers)", | ||
@@ -41,23 +41,23 @@ "author": "Braintree <code@getbraintree.com> (https://www.braintreepayments.com/)", | ||
"devDependencies": { | ||
"browserify": "13.0.1", | ||
"chai": "3.5.0", | ||
"chokidar-cli": "1.2.0", | ||
"eslint": "2.7.0", | ||
"eslint-config-braintree": "1.0.2", | ||
"express": "4.14.0", | ||
"jsdoc": "3.4.0", | ||
"karma": "1.1.1", | ||
"karma-browserify": "5.1.0", | ||
"browserify": "^16.2.3", | ||
"chai": "^4.2.0", | ||
"chokidar-cli": "^1.2.2", | ||
"eslint": "^5.16.0", | ||
"eslint-config-braintree": "^2.0.0", | ||
"express": "^4.16.4", | ||
"jsdoc": "^3.6.1", | ||
"karma": "^4.1.0", | ||
"karma-browserify": "^6.0.0", | ||
"karma-chai-sinon": "0.1.5", | ||
"karma-mocha": "1.1.1", | ||
"karma-mocha-reporter": "2.0.4", | ||
"karma-phantomjs-launcher": "1.0.1", | ||
"lodash.assign": "4.0.9", | ||
"mocha": "3.0.0", | ||
"phantomjs-prebuilt": "2.1.7", | ||
"karma-mocha": "^1.3.0", | ||
"karma-mocha-reporter": "^2.2.5", | ||
"karma-phantomjs-launcher": "^1.0.4", | ||
"lodash.assign": "^4.2.0", | ||
"mocha": "^6.1.4", | ||
"phantomjs-prebuilt": "^2.1.16", | ||
"sauce-connect-launcher": "0.14.0", | ||
"sinon": "1.17.4", | ||
"sinon-chai": "2.8.0", | ||
"sinon": "^7.3.2", | ||
"sinon-chai": "^3.3.0", | ||
"watchify": "^3.7.0" | ||
} | ||
} |
66367
28
1526