浏览代码

Ignore bogus events on IE (fixes #1040)

Ludovic Perrine 11 年之前
父节点
当前提交
370299c425
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      src/js/bootstrapValidator.js

+ 5 - 1
src/js/bootstrapValidator.js

@@ -449,7 +449,11 @@ if (typeof jQuery === 'undefined') {
                 case 'enabled':
                 /* falls through */
                 default:
-                    fields.off(events).on(events, function() {
+                    fields.off(events).on(events, function(e) {
+                        // ignore bogus input events on IE
+                        if ('input' === e.type && document.activeElement !== this) {
+                            return;
+                        }
                         if (that._exceedThreshold($(this))) {
                             that.validateField($(this));
                         }