Skip to content

Commit

Permalink
[ISSUE-283] Fix firefox default glow issue
Browse files Browse the repository at this point in the history
  • Loading branch information
nosir committed Jan 13, 2018
1 parent f181d39 commit 0f13b22
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 20 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"form",
"input"
],
"version": "1.0.9",
"version": "1.0.10",
"author": {
"name": "Max Huang",
"email": "[email protected]",
Expand Down
13 changes: 11 additions & 2 deletions dist/cleave-angular.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ return /******/ (function(modules) { // webpackBootstrap
/**
* Construct a new Cleave instance by passing the configuration object
*
* @param {String / HTMLElement} element
* @param {String | HTMLElement} element
* @param {Object} opts
*/
var Cleave = function (element, opts) {
Expand Down Expand Up @@ -113,7 +113,11 @@ return /******/ (function(modules) { // webpackBootstrap
owner.initDateFormatter();
owner.initNumeralFormatter();

owner.onInput(pps.initValue);
// avoid touch input field if value is null
// otherwise Firefox will add red box-shadow for <input required />
if (pps.initValue || (pps.prefix && !pps.noImmediatePrefix)) {
owner.onInput(pps.initValue);
}
},

initNumeralFormatter: function () {
Expand Down Expand Up @@ -352,6 +356,11 @@ return /******/ (function(modules) { // webpackBootstrap

updateValueState: function () {
var owner = this;

if (!owner.element) {
return;
}

var endPos = owner.element.selectionEnd;
var oldValue = owner.element.value;

Expand Down
6 changes: 3 additions & 3 deletions dist/cleave-angular.min.js

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion dist/cleave-react-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,11 @@ return /******/ (function(modules) { // webpackBootstrap
owner.initDateFormatter();
owner.initNumeralFormatter();

owner.onInput(pps.initValue);
// avoid touch input field if value is null
// otherwise Firefox will add red box-shadow for <input required />
if (pps.initValue || pps.prefix && !pps.noImmediatePrefix) {
owner.onInput(pps.initValue);
}

owner.registeredEvents.onInit(owner);
},
Expand Down Expand Up @@ -435,6 +439,11 @@ return /******/ (function(modules) { // webpackBootstrap

updateValueState: function updateValueState() {
var owner = this;

if (!owner.element) {
owner.setState({ value: owner.properties.result });
}

var endPos = owner.element.selectionEnd;
var oldValue = owner.element.value;
var newValue = owner.properties.result;
Expand Down
6 changes: 3 additions & 3 deletions dist/cleave-react-node.min.js

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion dist/cleave-react.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,11 @@ return /******/ (function(modules) { // webpackBootstrap
owner.initDateFormatter();
owner.initNumeralFormatter();

owner.onInput(pps.initValue);
// avoid touch input field if value is null
// otherwise Firefox will add red box-shadow for <input required />
if (pps.initValue || pps.prefix && !pps.noImmediatePrefix) {
owner.onInput(pps.initValue);
}

owner.registeredEvents.onInit(owner);
},
Expand Down Expand Up @@ -435,6 +439,11 @@ return /******/ (function(modules) { // webpackBootstrap

updateValueState: function updateValueState() {
var owner = this;

if (!owner.element) {
owner.setState({ value: owner.properties.result });
}

var endPos = owner.element.selectionEnd;
var oldValue = owner.element.value;
var newValue = owner.properties.result;
Expand Down
6 changes: 3 additions & 3 deletions dist/cleave-react.min.js

Large diffs are not rendered by default.

13 changes: 11 additions & 2 deletions dist/cleave.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ return /******/ (function(modules) { // webpackBootstrap
/**
* Construct a new Cleave instance by passing the configuration object
*
* @param {String / HTMLElement} element
* @param {String | HTMLElement} element
* @param {Object} opts
*/
var Cleave = function (element, opts) {
Expand Down Expand Up @@ -113,7 +113,11 @@ return /******/ (function(modules) { // webpackBootstrap
owner.initDateFormatter();
owner.initNumeralFormatter();

owner.onInput(pps.initValue);
// avoid touch input field if value is null
// otherwise Firefox will add red box-shadow for <input required />
if (pps.initValue || (pps.prefix && !pps.noImmediatePrefix)) {
owner.onInput(pps.initValue);
}
},

initNumeralFormatter: function () {
Expand Down Expand Up @@ -352,6 +356,11 @@ return /******/ (function(modules) { // webpackBootstrap

updateValueState: function () {
var owner = this;

if (!owner.element) {
return;
}

var endPos = owner.element.selectionEnd;
var oldValue = owner.element.value;

Expand Down
6 changes: 3 additions & 3 deletions dist/cleave.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"form",
"input"
],
"version": "1.0.9",
"version": "1.0.10",
"author": {
"name": "Max Huang",
"url": "http://github.com/nosir",
Expand Down

0 comments on commit 0f13b22

Please sign in to comment.