浏览代码

Fix for Firefox error when calling 'setSelectionRange' on hidden elements

Guilherme Rodrigues 13 年之前
父节点
当前提交
c8c284a1d6
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      js/jquery.inputmask.js

+ 3 - 0
js/jquery.inputmask.js

@@ -649,6 +649,9 @@
             }
 
             function caret(input, begin, end) {
+                if (!$(input).is(':visible')) {
+                    return;
+                }
                 var npt = input.jquery && input.length > 0 ? input[0] : input;
                 if (typeof begin == 'number') {
                     end = (typeof end == 'number') ? end : begin;