Skip to content

Commit

Permalink
Do not update undoValue in applyInputValue. RobinHerbots#2757
Browse files Browse the repository at this point in the history
- Instead rely on update of undoValue in blurEvent.
  • Loading branch information
niklaushug committed Nov 15, 2023
1 parent ccb8e7c commit 2329d82
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 16 deletions.
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
5 changes: 2 additions & 3 deletions dist/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(); else if ("function" == typeof define && define.amd) define([], t); else {
Expand Down Expand Up @@ -1960,8 +1960,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/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
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

0 comments on commit 2329d82

Please sign in to comment.