Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not update undoValue in applyInputValue. #2757 #2758

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- Enhance resolving of the ndxInitializer to determine the alternating tests.

### Fixed
- Do not update undoValue in applyInputValue. #2757
- d/mm/yyyy is converted to d/m//yyyd #2394 (WIP)
- how to get value from input-mask element? #2702
- Problem with seconds in format 'HH:MM:ss' #2745
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "inputmask",
"version": "5.0.9-beta.44",
"version": "5.0.9-beta.45",
"main": [
"./index.js",
"./css/inputmask.css"
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "robinherbots/inputmask",
"description": "Inputmask is a javascript library which creates an input mask. Inputmask can run against vanilla javascript, jQuery and jqlite.",
"version": "5.0.9-beta.44",
"version": "5.0.9-beta.45",
"type": "library",
"keywords": ["jquery", "plugins", "input", "form", "inputmask", "mask"],
"homepage": "http://robinherbots.github.io/Inputmask",
Expand Down
9,793 changes: 6,092 additions & 3,701 deletions dist/inputmask.js

Large diffs are not rendered by default.

6,112 changes: 6,109 additions & 3 deletions dist/inputmask.min.js

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions dist/jquery.inputmask.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2023 Robin Herbots
* Licensed under the MIT license
* Version: 5.0.9-beta.44
* Version: 5.0.9-beta.45
*/
!function(e, t) {
if ("object" == typeof exports && "object" == typeof module) module.exports = t(require("jquery")); else if ("function" == typeof define && define.amd) define([ "jquery" ], t); else {
Expand Down Expand Up @@ -1789,8 +1789,7 @@
function c(e, t) {
var n = e ? e.inputmask : this, i = n.opts;
e.inputmask.refreshValue = !1, "function" == typeof i.onBeforeMask && (t = i.onBeforeMask.call(n, t, i) || t),
f(e, !0, !1, t = (t || "").toString().split("")), n.undoValue = n._valueGet(!0),
(i.clearMaskOnLostFocus || i.clearIncomplete) && e.inputmask._valueGet() === r.getBufferTemplate.call(n).join("") && -1 === r.getLastValidPosition.call(n) && e.inputmask._valueSet("");
f(e, !0, !1, t = (t || "").toString().split("")), (i.clearMaskOnLostFocus || i.clearIncomplete) && e.inputmask._valueGet() === r.getBufferTemplate.call(n).join("") && -1 === r.getLastValidPosition.call(n) && e.inputmask._valueSet("");
}
function u(e) {
e.length = 0;
Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.inputmask.min.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions inputmask-pages/src/assets/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@

### Updates
- datetime alias
- add support for mmm & mmmm #2751
- add support for mmm & mmmm #2751 (WIP)
- Update IP extension to support greedy option. #2749
- Properly handle insertMode false in alternation logic.
- Enhance resolving of the ndxInitializer to determine the alternating tests.

### Fixed
- d/mm/yyyy is converted to d/m//yyyd #2394
- Do not update undoValue in applyInputValue. #2757
- d/mm/yyyy is converted to d/m//yyyd #2394 (WIP)
- how to get value from input-mask element? #2702
- Problem with seconds in format 'HH:MM:ss' #2745
- Remove unused mask - Take2 #2748
Expand Down
6 changes: 5 additions & 1 deletion lib/eventhandlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,11 @@ var EventHandlers = {
}

nptValue = inputmask._valueGet(true);
if (inputmask.undoValue !== nptValue) {

if (nptValue.includes('0.00')) {
inputmask.undoValue = nptValue;
$input.trigger("change");
} else if (inputmask.undoValue !== nptValue) {
if (nptValue != "" || (inputmask.undoValue != getBufferTemplate.call(inputmask).join("") || (inputmask.undoValue == getBufferTemplate.call(inputmask).join("") && inputmask.maskset.validPositions.length > 0))) {
inputmask.undoValue = nptValue;
$input.trigger("change");
Expand Down
1 change: 0 additions & 1 deletion lib/inputHandling.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ function applyInputValue(input, value) {
if (typeof opts.onBeforeMask === "function") value = opts.onBeforeMask.call(inputmask, value, opts) || value;
value = (value || "").toString().split("");
checkVal(input, true, false, value);
inputmask.undoValue = inputmask._valueGet(true);
if ((opts.clearMaskOnLostFocus || opts.clearIncomplete) && input.inputmask._valueGet() === getBufferTemplate.call(inputmask).join("") && getLastValidPosition.call(inputmask) === -1) {
input.inputmask._valueSet("");
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "inputmask",
"version": "5.0.9-beta.44",
"version": "5.0.9-beta.45",
"description": "Inputmask is a javascript library which creates an input mask. Inputmask can run against vanilla javascript, jQuery and jqlite.",
"main": "dist/inputmask.js",
"exports": {
Expand Down