Skip to content

Commit

Permalink
This line of code returns an unexpected value when unmasking as number
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinHerbots committed Feb 23, 2017
1 parent cf4695b commit abfbb80
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.
- initialization

### Fixed
- This line of code returns an unexpected value when unmasking as number #1527
- Phone Mask Cursor Issue on Chrome on some Androids.. #1490
- min value issue fix #1177
- static is a reserved keyword #1479
Expand Down
13 changes: 6 additions & 7 deletions js/inputmask.js
Original file line number Diff line number Diff line change
Expand Up @@ -1312,10 +1312,10 @@
//return is false or a json object => { pos: ??, c: ??} or true
rslt = test.fn != null ?
test.fn.test(chrs, getMaskSet(), position, strict, opts, isSelection(pos)) : (c === test.def || c === opts.skipOptionalPartCharacter) && test.def !== "" ? //non mask
{
c: getPlaceholder(position, test, true) || test.def,
pos: position
} : false;
{
c: getPlaceholder(position, test, true) || test.def,
pos: position
} : false;

if (rslt !== false) {
var elem = rslt.c !== undefined ? rslt.c : c;
Expand Down Expand Up @@ -1728,12 +1728,11 @@
}
input.inputmask._valueSet(buffer.join(""));
if (caretPos !== undefined && (event === undefined || event.type !== "blur")) {
caret(input, caretPos);
if (android && event.type === "input") {
setTimeout(function () {
caret(input, caretPos);
}, 0);
}
} else caret(input, caretPos);
} else renderColorMask(input, buffer, caretPos);
if (triggerInputEvent === true) {
skipInputEvent = true;
Expand Down Expand Up @@ -1871,7 +1870,7 @@
var unmaskedValue = umValue.length === 0 ? "" : (isRTL ? umValue.reverse() : umValue).join("");
if ($.isFunction(opts.onUnMask)) {
var bufferValue = (isRTL ? getBuffer().slice().reverse() : getBuffer()).join("");
unmaskedValue = (opts.onUnMask(bufferValue, unmaskedValue, opts) || unmaskedValue);
unmaskedValue = opts.onUnMask(bufferValue, unmaskedValue, opts);
}
return unmaskedValue;
}
Expand Down

0 comments on commit abfbb80

Please sign in to comment.