ソースを参照

update compositionevent

Robin Herbots 10 年 前
コミット
230781aa1b

+ 2 - 0
CHANGELOG.md

@@ -17,6 +17,8 @@ All notable changes to this project will be documented in this file.
 - Update placeholder handling
 
 ### Fixed
+- Chinese / Japanese characters are unable to mask #198
+- Infinite Loop on IE (v11) when using Japanese IME Keyboard #749
 - Delete key not working properly #799
 - Selecting and overwriting text will delete the character to the immediate right #914
 - Can't delete digits after decimal point on negative numbers #892

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
   "name": "jquery.inputmask",
-  "version": "3.1.64-59",
+  "version": "3.1.64-60",
   "main": [
     "./dist/inputmask/jquery.inputmask.js",
     "./dist/inputmask/jquery.inputmask.extensions.js",

+ 1 - 1
component.json

@@ -2,7 +2,7 @@
     "name": "jquery_inputmask",
     "repository": "robinherbots/jquery.inputmask",
     "description": "jquery.inputmask is a jquery plugin which create an input mask.",
-    "version": "3.1.64-59",
+    "version": "3.1.64-60",
     "keywords": [ "jquery", "plugins", "input", "form", "inputmask", "mask" ],
     "main": "./dist/jquery.inputmask.bundle.js",
     "scripts": [

+ 1 - 1
composer.json

@@ -1,7 +1,7 @@
 {
     "name": "robinherbots/jquery.inputmask",
     "description": "jquery.inputmask is a jquery plugin which create an input mask.",
-	"version": "3.1.64-59",
+	"version": "3.1.64-60",
     "type": "library",
     "keywords": ["jquery", "plugins", "input", "form", "inputmask", "mask"],
     "homepage": "http://robinherbots.github.io/jquery.inputmask",

+ 1 - 1
dist/inputmask/inputmask.date.extensions.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2015 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.1.64-59
+* Version: 3.1.64-60
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(jQuery);

ファイルの差分が大きいため隠しています
+ 1 - 1
dist/inputmask/inputmask.date.extensions.min.js


+ 1 - 1
dist/inputmask/inputmask.extensions.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2015 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.1.64-59
+* Version: 3.1.64-60
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(jQuery);

ファイルの差分が大きいため隠しています
+ 1 - 1
dist/inputmask/inputmask.extensions.min.js


+ 3 - 6
dist/inputmask/inputmask.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2015 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.1.64-59
+* Version: 3.1.64-60
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery")) : factory(jQuery);
@@ -985,11 +985,8 @@
             undoValue = getBuffer().join(""), ("" == compositionData || 0 != e.originalEvent.data.indexOf(compositionData)) && (compositionCaretPos = caret(input));
         }
         function compositionUpdateEvent(e) {
-            var input = this, caretPos = compositionCaretPos || caret(input);
-            0 == e.originalEvent.data.indexOf(compositionData) && (resetMaskSet(), caretPos = {
-                begin: 0,
-                end: 0
-            });
+            var input = this, caretPos = caret(input);
+            0 == e.originalEvent.data.indexOf(compositionData) && (resetMaskSet(), caretPos = compositionCaretPos);
             var newData = e.originalEvent.data;
             caret(input, caretPos.begin, caretPos.end);
             for (var i = 0; i < newData.length; i++) {

ファイルの差分が大きいため隠しています
+ 2 - 2
dist/inputmask/inputmask.min.js


+ 1 - 1
dist/inputmask/inputmask.numeric.extensions.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2015 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.1.64-59
+* Version: 3.1.64-60
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(jQuery);

ファイルの差分が大きいため隠しています
+ 1 - 1
dist/inputmask/inputmask.numeric.extensions.min.js


+ 1 - 1
dist/inputmask/inputmask.phone.extensions.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2015 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.1.64-59
+* Version: 3.1.64-60
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(jQuery);

ファイルの差分が大きいため隠しています
+ 1 - 1
dist/inputmask/inputmask.phone.extensions.min.js


+ 1 - 1
dist/inputmask/inputmask.regex.extensions.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2015 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.1.64-59
+* Version: 3.1.64-60
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(jQuery);

ファイルの差分が大きいため隠しています
+ 1 - 1
dist/inputmask/inputmask.regex.extensions.min.js


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

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2015 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.1.64-59
+* Version: 3.1.64-60
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(jQuery);

ファイルの差分が大きいため隠しています
+ 1 - 1
dist/inputmask/jquery.inputmask.min.js


+ 3 - 6
dist/jquery.inputmask.bundle.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2015 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.1.64-59
+* Version: 3.1.64-60
 */
 !function($) {
     function inputmask(options) {
@@ -983,11 +983,8 @@
             undoValue = getBuffer().join(""), ("" == compositionData || 0 != e.originalEvent.data.indexOf(compositionData)) && (compositionCaretPos = caret(input));
         }
         function compositionUpdateEvent(e) {
-            var input = this, caretPos = compositionCaretPos || caret(input);
-            0 == e.originalEvent.data.indexOf(compositionData) && (resetMaskSet(), caretPos = {
-                begin: 0,
-                end: 0
-            });
+            var input = this, caretPos = caret(input);
+            0 == e.originalEvent.data.indexOf(compositionData) && (resetMaskSet(), caretPos = compositionCaretPos);
             var newData = e.originalEvent.data;
             caret(input, caretPos.begin, caretPos.end);
             for (var i = 0; i < newData.length; i++) {

ファイルの差分が大きいため隠しています
+ 2 - 2
dist/jquery.inputmask.bundle.min.js


+ 4 - 27
js/inputmask.js

@@ -1727,7 +1727,7 @@
             if (eventHandler.type != "setvalue") {
               var handler = eventHandler.handler;
               eventHandler.handler = function(e) {
-                //console.log("triggered " + e.type);
+                // console.log("triggered " + e.type);
                 if (this.disabled || (this.readOnly && !(e.type == "keydown" && (e.ctrlKey && e.keyCode == 67) || e.keyCode == inputmask.keyCode.TAB)))
                   e.preventDefault();
                 else {
@@ -2171,27 +2171,7 @@
 
         return false;
       }
-      //function mobileInputEvent(e) {
-      //		var input = this;
-
-    //		//backspace in chrome32 only fires input event - detect & treat
-    //		var caretPos = caret(input),
-    //				currentValue = input._valueGet();
-
-    //		currentValue = currentValue.replace(new RegExp("(" + escapeRegex(getBufferTemplate().join('')) + ")*"), "");
-    //		//correct caretposition for chrome
-    //		if (caretPos.begin > currentValue.length) {
-    //				caret(input, currentValue.length);
-    //				caretPos = caret(input);
-    //		}
-    //		if ((getBuffer().length - currentValue.length) == 1 && currentValue.charAt(caretPos.begin) != getBuffer()[caretPos.begin]
-    //				&& currentValue.charAt(caretPos.begin + 1) != getBuffer()[caretPos.begin]
-    //				&& !isMask(caretPos.begin)) {
-    //				e.keyCode = inputmask.keyCode.BACKSPACE;
-    //				keydownEvent.call(input, e);
-    //		}
-    //		e.preventDefault();
-    //}
+
     function inputFallBackEvent(e) { //fallback when keypress & compositionevents fail
       var input = this;
       checkVal(input, true, false);
@@ -2212,13 +2192,10 @@
 
     function compositionUpdateEvent(e) {
       var input = this,
-        caretPos = compositionCaretPos || caret(input);
+        caretPos = caret(input);
       if (e.originalEvent.data.indexOf(compositionData) == 0) {
         resetMaskSet();
-        caretPos = {
-          begin: 0,
-          end: 0
-        };
+        caretPos = compositionCaretPos;
       }
       var newData = e.originalEvent.data;
       caret(input, caretPos.begin, caretPos.end);

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "jquery.inputmask",
-  "version": "3.1.64-59",
+  "version": "3.1.64-60",
   "description": "jquery.inputmask is a jquery plugin which create an input mask.",
   "main": "./dist/inputmask/jquery.inputmask.js",
   "files": [