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 77ed2dc commit f181d39
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/Cleave.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ Cleave.prototype = {
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
6 changes: 5 additions & 1 deletion src/Cleave.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@ var Cleave = CreateReactClass({
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

0 comments on commit f181d39

Please sign in to comment.