Browse Source

better scrollhandling

Robin Herbots 11 years ago
parent
commit
50be80c320
1 changed files with 2 additions and 1 deletions
  1. 2 1
      js/jquery.inputmask.js

+ 2 - 1
js/jquery.inputmask.js

@@ -1025,7 +1025,8 @@
                         return;
                     }
 
-                    npt.scrollLeft = ($(npt).css("font-size").replace("px", "") * end) > npt.scrollWidth ? npt.scrollWidth : 0;
+                    var scrollCalc = $(npt).css("font-size").replace("px", "") * end;
+                    npt.scrollLeft = scrollCalc > npt.scrollWidth ? scrollCalc : 0;
                     if (opts.insertMode == false && begin == end) end++; //set visualization for insert/overwrite mode
                     if (npt.setSelectionRange) {
                         npt.selectionStart = begin;