Browse Source

fix commit when still focus

Robin Herbots 11 years ago
parent
commit
958178eb74

File diff suppressed because it is too large
+ 58 - 58
dist/inputmask/jquery.inputmask.js


+ 2 - 1
dist/jquery.inputmask.bundle.js

@@ -1511,7 +1511,8 @@
                     $el.closest('form').bind("submit", function () { //trigger change on submit if any
                         if (valueOnFocus != getBuffer().join('')) {
                             $el.change();
-                        } else $el[0]._valueSet(''); //clear masktemplete on submit and still has focus
+                        } else if ($el[0]._valueGet() == getBufferTemplate().join(''))
+                            $el[0]._valueSet(''); //clear masktemplete on submit and still has focus
                         if (opts.autoUnmask && opts.removeMaskOnSubmit) {
                             $el.inputmask("remove");
                         }

File diff suppressed because it is too large
+ 38 - 38
dist/jquery.inputmask.bundle.min.js


+ 2 - 1
js/jquery.inputmask.js

@@ -1511,7 +1511,8 @@
                     $el.closest('form').bind("submit", function () { //trigger change on submit if any
                         if (valueOnFocus != getBuffer().join('')) {
                             $el.change();
-                        } else $el[0]._valueSet(''); //clear masktemplete on submit and still has focus
+                        } else if ($el[0]._valueGet() == getBufferTemplate().join(''))
+                            $el[0]._valueSet(''); //clear masktemplete on submit and still has focus
                         if (opts.autoUnmask && opts.removeMaskOnSubmit) {
                             $el.inputmask("remove");
                         }